-
Notifications
You must be signed in to change notification settings - Fork 0
/
NUMBER.HPB
28 lines (28 loc) · 964 Bytes
/
NUMBER.HPB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
100 REM *** NUMBER *** A NUMBER GUESSING GAME ***
110 REM *** COPYRIGHT PEOPLE'S COMPUTER COMPANY
120 REM *** P. O. BOX 310, MENLO PARK CA 94025
200 REM *** PRINT INSTRUCTIONS ON HOW TO PLAY
210 PRINT "I WILL THINK OF A WHOLE NUMBER FROM 1 TO 100."
220 PRINT "TRY TO GUESSMY NUMBER. AFTER EACH GUESS, I WILL"
230 PRINT "TELL YOU IF YOU HAVE GUESSED MY NUMBER OR IF YOUR"
240 PRINT "GUESS IS TOO SMALL OR TOO BIG."
300 REM *** COMPUTER 'THINKS' IF A NUMBER - CALL IT X
310 LET X=INT(100*RND(0))+1
320 PRINT
330 PRINT "OK, I HAVE A NUMBER. START GUESSING."
400 REM *** HUMAN STARTS GUESSING
410 PRINT
420 PRINT "WHAT IS YOUR GUESS";
430 INPUT G
440 IF G=X THEN 510
450 IF G>X THEN 480
460 PRINT "TOO SMALL. TRY A LARGER NUMBER."
470 GOTO 410
480 PRINT "TOO BIG. TRY A SMALLER NUMBER."
490 GOTO 410
500 REM *** HUMAN HAS GUESSED THE COMPUTER'S NUMBER
510 PRINT
520 PRINT "YOU GUESSED IT!!! LET'S PLAY AGAIN."
530 PRINT
540 GO TO 310
999 END