1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-06 02:20:25 +00:00
QB64-PE/tests/qbasic_testcases/pete/stones.bas
Matthew Kilgore 9ee89d6ff4 Add QBasic tests
These tests use a variety of sample code (with some of the larger files
removed, so they are not complete!) and verifies that they all compile
successfully.
2022-04-28 23:00:07 -04:00

19 lines
422 B
QBasic

5 RANDOMIZE TIMER
10 A = 25
20 CLS
25 FOR B = 1 TO A
30 PRINT "* ";
35 NEXT B
37 PRINT
40 PRINT "HOW MANY TO TAKE AWAY"
45 INPUT C
50 IF C > 3 THEN PRINT "YOU CAN ONLY TAKE AWAY 1,2, OR 3 STONES.": GOTO 40
60 A = A - C
65 IF A = 0 THEN PRINT "YOU WIN!": END
70 D = (A MOD 4)
75 IF D = 0 THEN D = INT(3 * RND(1)) + 1
80 PRINT "I TOOK AWAY "; D; "STONES"
83 SLEEP
85 A = A - D
90 IF A = 0 THEN PRINT "I WIN": END
100 GOTO 20