Skip to content

Instantly share code, notes, and snippets.

@tomaes
Created May 2, 2019 09:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomaes/a373f4c0a227d0f05c18f48af67ded3d to your computer and use it in GitHub Desktop.
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. ;)
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