Files
basicinterpreter/basicenvironment.go
Andrew Kesterson e2df01b257 FOR automatic step generation is working in both positive and negative directions, but with STEP values <> 1, the loop will step past the end of the intended range
10 FOR A# = 1 TO 5 STEP 1
20 PRINT A#
30 NEXT A#
RUN
1
2
3
4
5
READY
10 FOR A# = 5 TO 1 STEP 1
RUN
5
READY
10 FOR A# = 5 TO 1 STEP -1
RUN
5
4
3
2
1
READY
10 FOR A# = 5 TO 1 STEP -3
RUN
5
2
-1
READY
10 FOR A# = 5 TO -1 STEP -3
RUN
5
2
-1
READY
QUIT
2025-01-20 17:57:23 -05:00

2.0 KiB