MicroWorlds Wiki
Advertisement


ifelse true-or-false instruction-list1 instruction-list2

Runs the first instruction list if the condition is true. Runs the second instruction list if the condition is false. See if.

Example:

ifelse colorunder = 15

      [fd 50]
      [bk 50]

This instruction can be used to get an answer to a question dialog box. If the answer is not empty, it is displayed in a text box.

to insist

question [Your name please...]

ifelse empty? answer [insist] [settext1 answer] end

Advertisement