1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-09-04 11:10:15 +00:00
qb64/programs/samples/pete/stones.bas
SMcNeill 6e01fc8dce Altered string compare routines (<,<=,>,>=) so they don't give false results with CHR$(0).
Added new _STRCMP and _STRICMP commands for quick string comparisons.
Cleaned up QB64 to finish removing the QUI (quick user insert) code and folders.
Altered UCASE and LCASE routines to be faster in some situations for us.
2014-09-22 08:19:03 -04:00

19 lines
No EOL
440 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