10 PRINT TAB(32);"STARS"
20 PRINT TAB(15);"Creative Computing Morristown, New Jersey"
30 PRINT:PRINT:PRINT
100 REM *** STARS - PEOPLE'S COMPUTER CENTRE, MENLO PARK, CA
140 REM *** A IS LIMIT ON NUMBER, M IS NUMBER OF GUESSES
150 A=100: M=7
170 INPUT "Do you want instructions (y/n)";A$
190 IF A$="N" OR A$="n" THEN 280
200 REM *** INSTRUCTIONS ON HOW TO PLAY
210 PRINT "I am thinking of a whole number from 1 to";A;"."
220 PRINT "Try to guess my number.  After you guess, I"
230 PRINT "will type one or more stars (*).  The more"
240 PRINT "stars I type, the closer you are to my number."
250 PRINT "One star (*) means far away, seven stars (*******)"
260 PRINT "means really close!  You get";M;"guesses."
270 REM *** COMPUTER THINKS OF A NUMBER
280 PRINT
290 PRINT
300 X=INT(A*RND(1)+1)
310 PRINT "Ok, I am thinking of a number, start guessing."
320 REM *** GUESSING BEGINS, HUMAN GETS M GUESSES
330 FOR K=1 TO M
340 PRINT
350 PRINT "Your guess";
360 INPUT G
370 IF G=X THEN 600
380 D=ABS(G-X)
390 IF D>=64 THEN 510
400 IF D>=32 THEN 500
410 IF D>=16 THEN 490
420 IF D>=8 THEN 480
430 IF D>=4 THEN 470
440 IF D>=2 THEN 460
450 PRINT "*";
460 PRINT "*";
470 PRINT "*";
480 PRINT "*";
490 PRINT "*";
500 PRINT "*";
510 PRINT "*";
520 PRINT
530 NEXT K
540 REM *** DID NOT GUESS IN M GUESSES
550 PRINT
560 PRINT "Sorry, that's";M;"guesses, number was";X;"."
580 GOTO 650
590 REM *** WE HAVE A WINNER
600 FOR N=1 TO 50
610 PRINT "*";
620 NEXT N
630 PRINT "!!!"
640 PRINT "You got it in";K;"guesses!!!"
650 PRINT "Do you want to play again";
660 INPUT Q$
670 IF Q$="Y" OR Q$="y" THEN 280
680 END
ou got it in";K;