Last active
October 25, 2023 18:27
-
-
Save banterCZ/9a9672351ce160a5bf7d69057e41c6cb to your computer and use it in GitHub Desktop.
Number Guessing Game
This file contains hidden or 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
5 INPUT "ENTER UPPER LIMIT FOR GUESS ";LI | |
10 NM = INT(LI*RND(1))+1 | |
15 CN = 0 | |
20 PRINT "I'VE GOT THE NUMBER. " :PRINT | |
30 INPUT "WHAT'S YOUR GUESS"; GU | |
35 CN = CN + 1 | |
40 IF GU > NM THEN PRINT "MY NUMBER IS LOWER": PRINT: GOTO 30 | |
50 IF GU < NM THEN PRINT "MY NUMBER IS HIGHER": PRINT: GOTO 30 | |
60 PRINT "GREAT! YOU GOT MY NUMBER" | |
65 PRINT "IN ONLY "; CN ;"GUESSES. ":PRINT | |
70 PRINT "DO YOU WANT TO TRY ANOTHER (Y/N)"; | |
80 GET AN$: IF AN$ = "" THEN 80 | |
90 IF AN$ = "Y" THEN 5 | |
100 IF AN$ <> "N" THEN 70 | |
110 END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You may run it at https://retrogamecoders.com/c64-emulator/