mirror of
https://github.com/rfivet/BCG101.git
synced 2024-12-29 21:46:32 -05:00
27 lines
946 B
QBasic
27 lines
946 B
QBasic
|
90 RANDOMIZE
|
||
|
100 PRINT "THIS IS THE GAME OF HI-LO"\PRINT
|
||
|
110 PRINT "YOU WILL HAVE 6 TRIES TO GUESS THE AMOUNT OF MONEY IN THE"
|
||
|
120 PRINT "HI-LO JACKPOT, WHICH IS BETWEEN 1AND 100 DOLLARS. IF YOU"
|
||
|
130 PRINT "GUESS THE AMOUNT, YOU WIN ALL THE MONEY IN THE JACKPOT!"
|
||
|
140 PRINT "THEN YOU GET ANOTHER CHANCE TO WIN MORE MONEY. HOWEVER,"
|
||
|
150 PRINT "IF YOU DO NOT GUESS THE AMOUNT, THE GAME ENDS."\PRINT
|
||
|
160 R=0
|
||
|
170 B=0\PRINT
|
||
|
180 Y=INT(100*RND)
|
||
|
200 PRINT "YOUR GUESS";
|
||
|
210 INPUT A
|
||
|
220 B=B+1
|
||
|
230 IF A=Y THEN 300
|
||
|
240 IF A>Y THEN 270
|
||
|
250 PRINT "YOUR GUESS IS TOO LOW"\GOTO 280
|
||
|
270 PRINT "YOUR GUESS IS TOO HIGH"
|
||
|
280 PRINT\IF B<6 THEN 200
|
||
|
290 PRINT "YOU BLEW IT....TOO BAD....THE NUMBER WAS"Y\R=0\GOTO 350
|
||
|
300 PRINT "GOT IT!!!!!!!! YOU WIN"Y"DOLLARS."
|
||
|
310 R=R+Y
|
||
|
320 PRINT "YOUR TOTAL WINNINGS ARE NOW"R"DOLLARS."
|
||
|
350 PRINT\PRINT "PLAY AGAIN (YES OR NO)";
|
||
|
360 INPUT A$\IF A$="YES" THEN 170
|
||
|
380 PRINT\PRINT "SO LONG. HOPE YOU ENJOYED YOURSELF!!"
|
||
|
390 END
|