Un-Random

See all articles from ZX-Appeal May 87
Author(s): Vince Lee
Publication: ZX-Appeal
Pub Details: ZX-Appeal May 87
Date: May 1987
Pages: 15

This is a typical “guess the number” game. With one hundred possibilities it seems impossible to get the correct answer.

   5 SLOW
10 RAND
20 LET R=0
30 LET W=R
40 LET N=INT (RND*100)
50 PRINT AT 4,13;"E S P";AT 21,0;"RIGHT: ";R;TAB 21;"WRONG: ";W;AT 12,7;"WHAT IS MY NUMBER?";AT 13,7;" "
60 INPUT I
70 IF I<>N THEN GOTO 110
80 PRINT AT 12,7;"THAT IS RIGHT. "
90 LET R=R+1
100 GOTO 130
110 PRINT AT 12,7;"THAT IS WRONG. "
120 LET W=W+1
130 PRINT TAB 7;"MY ANSWER IS ";AT 13,20;N
140 GOTO 40

Instead of entering numbers, just enter the variable “N” and the computer will be tricked into thinking that the correct answer has been given.

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.