Created
May 2, 2019 09:42
-
-
Save tomaes/a373f4c0a227d0f05c18f48af67ded3d to your computer and use it in GitHub Desktop.
Miniature Edutainment Game in GW-BASIC. A minor tribute to the first programming language I came in contact with. Back when Pangea was still a thing. ;)
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
110 REM the sum of parts. GW-Basic edition | |
120 A$ = "" | |
125 RANDOMIZE TIMER | |
130 FOR I=0 TO 19 | |
140 N% = INT(RND(1)*10) | |
150 S% = S% + N% | |
160 A$ = A$ + CHR$(48+N%) + "+" | |
170 NEXT | |
180 A$ = LEFT$(A$,LEN(A$)-1) + "=" | |
190 CLS: LOCATE 12,1: PRINT A$ | |
200 T = TIMER | |
202 IF TIMER < T+10 THEN 202 | |
210 CLS | |
220 R% = 1 | |
230 INPUT "Solution"; I%: if I% <> S% THEN 900 | |
800 PRINT "Correct!" | |
802 BEEP | |
810 T = TIMER | |
815 IF TIMER < T+2 THEN 815 | |
820 R% = R% + S% | |
830 GOTO 180 | |
900 PRINT "Score:"; R%; "Sum:"; S% | |
910 END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment