Home
Project Folders
Teacher Resources
Student Resources
How Do I?
Literacy
MWForum
Site Map
Search
Our Team

MWForum Message [Date Index] [Threads] [Authors] [Attachments] [Subscribe]

[Thread Prev] [Thread Next]

To: "Fabian Franke" <Fabi_1990@xxxxxx>, MWForum <mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: MIA, Ask an Expert: If with more that two conditions
From: "Daniel Ajoy" <da.ajoy@xxxxxxxxx>
Date: Wed, 06 Jul 2011 14:29:15 -0500

On Wed, 06 Jul 2011 14:24:13 -0500, Fabian Franke <Fabi_1990@xxxxxx> wrote:

Thank you for your answer. It really worked great ;)

Now, just one problem is left: I want to combine an or-condition and an and-condition in one if-question. My code works, but combining would be great.

if (and :Punktestand > 9 :Punktestand < 13)
[winman]

if :Punktestand = 9 [winman]

So the first if is "and" and the second if is "or". Can i now combine the two if-questions?

Like this:


if (and :Punktestand > 9 :Punktestand < 13) (or :Punktestand = 9) [winman]


MicroWorlds uses Prefix notation (except for arithmetic)

http://simple.wikipedia.org/wiki/Prefix_notation


So your code should be:

if or :Punktestand = 9 and :Punktestand > 9 :Punktestand < 13  [winman]

or if it makes you more comfortable:

if (or (:Punktestand = 9) (and (:Punktestand > 9) (:Punktestand < 13))) [winman]


Daniel
OpenWorld Learning



  • Previous by thread: Re: MIA, Ask an Expert: If with more that two conditions
  • Next by thread: MIA, Ask an Expert: Cancel a repeated launch-command

  • To save an attachment to your computer, PC users should right-click (Mac users, click and hold the mouse button) on the link and then choose 'save target as' from the pop-up menu. A window will then pop up in which you can choose a location for the file.


    © copyright 2001 - 2008