FANDOM


Syntax

IF statement THEN instructionlist ELSE instructionlist

Explanation

ELSE runs its input if the conditional statement which precedes it is FALSE. ELSE is used in conjuction with IF. See also IF and THEN.

Examples

The following procedure lets you guess the animal you supply as input.

TO GUESS :ANIMAL

PR [WHAT ANIMAL AM I THINKING OF?]

MAKE "CHOICE FIRST READLIST

IF :ANIMAL = :CHOICE THEN PR[CORRECT ANSWER] GUESS :ANIMAL

END

? GUESS "CAT

WHAT ANIMAL AM I THINKING OF?

? DOG

TRY AGAIN

? CAT

CORRECT ANSWER

?

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.