File GUESS.BA (BASIC source file)

Directory of image this file is from
This file as a plain text file

5  REM *** CONVERTED FROM THE ORIGINAL FOCAL PROGRAM TO BASIC BY
6  REM *** DAVID AHL, DIGITAL
7 REMARKABLY TRANSLATED TO OS8 BASIC BY KAY R. FISHER ...DEC
10 PRINT "I HAVE CHOSEN AN INTEGER 0 THROUGH 100.  TRY TO"
15 PRINT "GUESS MY NUMBER IN AS FEW TRIES AS POSSIBLE."
16 PRINT
20 LET C=0
22 RANDOMIZE
25 LET N=INT(RND(0)*100)
30 LET C=C+1
35 PRINT "YOUR GUESS IS";
40 INPUT G
45 IF N=G THEN 70
50 IF G>N THEN 60
55 PRINT "TOO LOW"
56 GO TO 30
60 PRINT "TOO HIGH"
65 GO TO 30
70 PRINT "CORRECT IN";C;"GUESSES."
75 IF C>3 THEN 90
80 PRINT "YOU WERE LUCKY!"
85 GOTO 105
90 IF C>7 THEN 100
95 PRINT "GOOD JOB."
98 GOTO 105
100 PRINT "BUT YOU SHOULDN'T NEED MORE THAN 7 GUESSES."
105 PRINT\PRINT "LET'S PLAY AGAIN"
110 PRINT "I'M THINKING OF ANOTHER NUMBER"\GOTO 20
999 END



Feel free to contact me, David Gesswein djg@pdp8online.com with any questions, comments on the web site, or if you have related equipment, documentation, software etc. you are willing to part with.  I am interested in anything PDP-8 related, computers, peripherals used with them, DEC or third party, or documentation. 

PDP-8 Home Page   PDP-8 Site Map   PDP-8 Site Search