-
Notifications
You must be signed in to change notification settings - Fork 0
/
NUMBER.BAS
43 lines (43 loc) · 1.25 KB
/
NUMBER.BAS
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
0 RANDOMIZE
1 PRINT CHR$(26):WIDTH 80:PRINT TAB(33);"NUMBER":PRINT
2 PRINT TAB(15);"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY"
3 PRINT:PRINT:PRINT
4 PRINT "YOU HAVE 100 POINTS. BY GUESSING NUMBERS FROM 1 TO 5, YOU"
5 PRINT "CAN GAIN OR LOSE POINTS DEPENDING UPON HOW CLOSE YOU GET TO"
6 PRINT "A RANDOM NUMBER SELECTED BY THE COMPUTER.": PRINT
7 PRINT "YOU OCCASIONALLY WILL GET A JACKPOT WHICH WILL DOUBLE(!)"
8 PRINT "YOUR POINT COUNT. YOU WIN WHEN YOU GET 500 POINTS."
9 PRINT: P=100
10 DEF FNR(X)=INT(5*RND(1)+1)
12 INPUT "GUESS A NUMBER FROM 1 TO 5";G
15 R=FNR(1)
16 S=FNR(1)
17 T=FNR(1)
18 U=FNR(1)
19 V=FNR(1)
20 IF G=R THEN 30
21 IF G=S THEN 40
22 IF G=T THEN 50
23 IF G=U THEN 60
24 IF G=V THEN 70
25 IF G>5 THEN 12
30 P=P-5
35 GOTO 80
40 P=P+5
45 GOTO 80
50 P=P+P
53 PRINT "YOU HIT THE JACKPOT!!!"
55 GOTO 80
60 P=P+1
65 GOTO 80
70 P=P-(P*.5)
80 IF P>500 THEN 90
82 PRINT "YOU HAVE";P;"POINTS.":PRINT
83 IF P<=0 THEN PRINT "YOU RAN OUT OF POINTS. YOU LOSE!":GOTO 93
85 GOTO 12
90 PRINT "!!!!YOU WIN!!!! WITH ";P;"POINTS."
93 PRINT
95 INPUT "WOULD YOU LIKE TO PLAY AGAIN";ANS$
96 IF LEFT$(ANS$,1)="Y" THEN 9
99 RUN "MENU"