Add variable storage (scalar and array), program line storage with RUN/LIST/NEW, and full control flow: FOR/NEXT, GOTO, GOSUB/RETURN, IF/THEN/ELSE, WHILE/WEND, ON GOTO/GOSUB, DATA/READ/RESTORE. New modules: interp.c (1445 lines - execution loop and statement dispatcher), vars.c, arrays.c, input.c. Version bumped to 0.2.0. 16 test programs pass including Leibniz pi and prime sieve.
10 lines
178 B
QBasic
10 lines
178 B
QBasic
10 REM DATA/READ test
|
|
20 DATA 10, 20, 30, "hello", "world"
|
|
30 READ A, B, C
|
|
40 PRINT A; B; C
|
|
50 READ D$, E$
|
|
60 PRINT D$; " "; E$
|
|
70 RESTORE
|
|
80 READ X
|
|
90 PRINT "After RESTORE:"; X
|