home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Oakland CPM Archive
/
oakcpm.iso
/
cpmug
/
cpmug044.ark
/
ROBO.BAS
< prev
next >
Wrap
BASIC Source File
|
1984-04-29
|
2KB
|
65 lines
PRINT "THIS IS A PROGRAM TO ADD TWO NUMBERS"
10 PRINT "What is your name";
INPUT NAME$
L%=0 REM Number correct answers
K%=0 REM Number wrong answers in a batch
J%=0 REM Total of wrong answers
11 RANDOMIZE
N%=INT(15*RND)
M%=INT(13*RND)
15 K%=0
PRINT
PRINT "--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|"
PRINT " 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 "
PRINT NAME$;", Here are two numbers for you to add:"; N%;" + ";M%
18 PRINT "WHAT DO YOU THINK THE ANSWER IS";
INPUT D%
S%= N%+M%
21 IF D%= S% THEN 25
PRINT "No. I'm sorry that your answer is not correct. Try again."
K%=K%+1
J%=J%+1
WHILE K%=4 REM stop before too many mistakes are made
PRINT
PRINT
PRINT "Perhaps this problem is too grownup for you. We'll try another."
PRINT
PRINT
GOTO 11
WEND
GOTO 18
25 PRINT CHR$(07) REM ring the bell
PRINT "VERY GOOD; THE SUM OF THE NUMBERS IS"; S%
L%=L%+1
30 PRINT "DO YOU HAVE MORE TO DO (YES OR NO)";
32 INPUT C$
35 IF C$ ="YES" THEN 11
PRINT "You just answered ";L%;" questions right and ";J%; " not correct."
PERCENT = L%/(L%+J%) * 100.0
REM PRINT "Your score is ";PERCENT;"%." **************
REM IF PERCENT>80.0 THEN PRINT "That's very good!" **************
60 PRINT ""
65 PRINT "YOU HAVE BEEN A GREAT LITTLE PLAYER AND I HOPE YOU'LL PLAY AGAIN."
70 PRINT "Will you play again sometime, ";NAME$;"?"
75 INPUT B$
80 IF B$ = "YES" THEN 82
81 GOTO 91
82 PRINT
PRINT
PRINT
PRINT " O BBBBB O YY YY II "
85 PRINT " OOO BB BB OOO YY YY II "
86 PRINT " OO OO BB BB OO OO YYYY II "
87 PRINT " OO OO BBBBB OO OO YY II "
88 PRINT " OOO BB BB OOO YY "
89 PRINT " O BBBBB O YY ** "
PRINT
PRINT
90 PRINT "GEE, THANKS A LOT,";NAME$;" ,I CAN HARDLY WAIT!!!!"
91 PRINT "IT WOULD MAKE ME UNHAPPY NOT TO PLAY AGAIN!"
PRINT "Is there someone else out there who wants to play?";
INPUT WRD$
IF WRD$="YES" THEN GOTO 10
95 END
EOF