FANDOM


Syntax

TEST statement

Explanation

TEST determines whether its input is TRUE or FALSE and remembers it for later use in an IFTRUE or IFFALSE statement.

Example

TO GUESSNUM

MAKE "NUM RANDOM 10
PR [I'M THINKING OF A NUMBER BETWEEN 1 AND 10.]
LABEL "LOOP
TYPE [CAN YOU GUESS IT]
MAKE "GUESS READ
TEST (:NUM = :GUESS)
IFTRUE [PR [GOOD GUESS!] STOP]
IFFALSE [PR [NO, TRY AGAIN.]]
GO "LOOP

END

? GUESSNUM

I'M THINKING OF A NUMBER BETWEEN 1 AND 10.

CAN YOU GUESS IT? 3

NO TRY AGAIN.

CAN YOU GUESS IT? 7

GOOD GUESS!

?

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.