24 lines
687 B
Plaintext
24 lines
687 B
Plaintext
|
BEGIN
|
||
|
on logical file end (stand in,
|
||
|
(REF FILE f) BOOL: (print(("Goodbye!",new line));stop));
|
||
|
|
||
|
first random(ENTIER(seconds)); # Seed with current seconds #
|
||
|
INT random_number = ENTIER (next random * 100.0) + 1;
|
||
|
|
||
|
print(("the secret number is",random_number,new line));
|
||
|
|
||
|
print("guess a number: ");
|
||
|
WHILE
|
||
|
INT guess = read int;
|
||
|
IF guess < random_number THEN
|
||
|
print("too low, try again: ");
|
||
|
TRUE
|
||
|
ELIF guess > random_number THEN
|
||
|
print("too high, try again: ");
|
||
|
TRUE
|
||
|
ELSE
|
||
|
print(("that's right",new line));
|
||
|
FALSE
|
||
|
FI
|
||
|
DO SKIP OD
|
||
|
END
|