Phase 2: variables, arrays, program execution, and control flow
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.
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
10 REM WHILE/WEND test
|
||||
20 X = 1
|
||||
30 WHILE X <= 10
|
||||
40 IF X MOD 2 = 0 THEN PRINT X;
|
||||
50 X = X + 1
|
||||
60 WEND
|
||||
70 PRINT
|
||||
80 PRINT "Done"
|
||||
Reference in New Issue
Block a user