Closed skx closed 5 years ago
10 FOR I = 1 TO 10 STEP 2
20 PRINT I, "\n"
30 NEXT I
Prints 1, 3, 5, 7, 9
.
I guess we test if the loop is "up" or "down" and test for >= END on each iteration.
Of course ">=" doesn't matter if START==END we must run one iteration. Hrm.
The following example code was emailed to me:
Output? Constant numbers.
Expected output? zero numbers. There shouldn't even be a single iteration.
A similar situation is:
On my system that never terminates. On a real spectrum it produces: