Last active
August 29, 2015 14:06
-
-
Save CernerJT/c83d1ec8d3e28c0d1d2e to your computer and use it in GitHub Desktop.
Day 5 (9/17): My first programming language
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 REM BEING A CERNER ENGINEER MEANS HAVING TINKERING IN YOUR BLOOD | |
2 REM THIS IS A PROGRAM I WROTE IN THE THIRD GRADE IN A NOTEBOOK | |
3 REM YOU CAN'T WIN | |
4 REM TYPE THIS INTO A COMMODORE 64 EMULATOR. IT'LL WORK | |
10 LET A%=16 | |
20 PRINT "THERE ARE"+STR$(A%)+" MATCHES LEFT. TAKE 1 OR 2" | |
30 INPUT B% | |
40 IF B%=1 OR B%=2 THEN GOTO 70 | |
50 PRINT "ONLY PICK 1 OR 2" | |
60 GOTO 30 | |
70 A%=A%-B% | |
80 IF A% > 0 THEN GOTO 110 | |
90 PRINT "HA! HA! YOU LOSE!" | |
100 END | |
110 IF B%=1 THEN GOTO 140 | |
120 LET C%=1 | |
130 GOTO 150 | |
140 LET C%=2 | |
150 PRINT "THERE ARE"+STR$(A%)+" MATCHES LEFT. I PICK"+STR$(C%) | |
160 A%=A%-C% | |
170 IF A% > 0 THEN GOTO 20 | |
180 PRINT "YOU WIN!!!!" | |
190 END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you must win... change line 10 to read:
10 LET A%=15