skx / gobasic

A BASIC interpreter written in golang.
https://blog.steve.fi/tags/basic/
GNU General Public License v2.0
323 stars 27 forks source link

STEP should accept an expression. #69

Closed skx closed 5 years ago

skx commented 5 years ago

So I was reading some Python code of another BASIC interpreter, and that said that STEP should accept an expression, which makes sense.

Currently we do not, we just assume an integer.

We should allow this program to run:

 10 LET a = 4
 20 LET b = 10
 30 FOR I = 0 TO 60 STEP b - a
 40 PRINT I, " "
 50 NEXT I

(i.e. The step is 6).