1 PRINT "TRAP"
2 PRINT "CREATIVE COMPUTING  MORRISTOWN, NEW JERSEY"
3 PRINT:PRINT:PRINT
10 G=6
20 N=100
30 REM-TRAP
40 REM-STEVE ULLMAN, 8-1-72
50 INPUT "INSTRUCTIONS (0 = no, 1 = yes) ";Z
70 IF Z=0 THEN GOTO 180
80 PRINT "I AM THINKING OF A NUMBER BETWEEN 1 AND ";N
90 PRINT "TRY TO GUESS MY NUMBER. ON EACH GUESS,"
100 PRINT "YOU ARE TO ENTER 2 NUMBERS, TRYING TO TRAP"
110 PRINT "MY NUMBER BETWEEN THE TWO NUMBERS. I WILL"
120 PRINT "TELL YOU IF YOU HAVE TRAPPED MY NUMBER, IF MY"
130 PRINT "NUMBER IS LARGER THAN YOUR TWO NUMBERS, OR IF"
140 PRINT "MY NUMBER IS SMALLER THAN YOUR TWO NUMBERS."
150 PRINT "IF YOU WANT TO GUESS ONE SINGLE NUMBER, TYPE"
160 PRINT "YOUR GUESS FOR BOTH YOUR TRAP NUMBERS."
170 PRINT "YOU GET ";G;" GUESSES TO GET MY NUMBER."
180 X=((N*RND(100))/100)+1
190 FOR Q=1 TO G
200 PRINT 
210 PRINT "GUESS #";Q;
220 INPUT A : INPUT B
230 IF A=B THEN IF X=A THEN GOTO 400
240 IF A<B THEN GOTO 260
245 IF A=B THEN GOTO 260
250 GOSUB 360
260 IF A>X THEN GOTO 270
263 IF X>B THEN GOTO 270
266 GOTO 320
270 IF X<A THEN GOTO 300
280 PRINT "MY NUMBER IS LARGER THAN YOUR TRAP NUMBERS."
290 GOTO 330
300 PRINT "MY NUMBER IS SMALLER THAN YOUR TRAP NUMBERS."
310 GOTO 330
320 PRINT "YOU HAVE TRAPPED MY NUMBER."
330 NEXT
340 PRINT "SORRY, THAT'S ";G;" GUESSES. THE NUMBER WAS ";X
345 PRINT
350 GOTO 410
360 R=A
370 A=B
380 B=R
390 RETURN 
400 PRINT "YOU GOT IT!!!"
410 PRINT 
420 PRINT "TRY AGAIN."
430 END
