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.
11 lines
150 B
QBasic
11 lines
150 B
QBasic
10 REM FOR/NEXT test
|
|
20 FOR I = 1 TO 5
|
|
30 PRINT I;
|
|
40 NEXT I
|
|
50 PRINT
|
|
60 REM FOR with STEP
|
|
70 FOR I = 10 TO 0 STEP -2
|
|
80 PRINT I;
|
|
90 NEXT I
|
|
100 PRINT
|