AZHenley / teenytinycompiler

A small BASIC-to-C compiler written in Python.
MIT License
339 stars 49 forks source link

Question: no loop termination? #1

Closed fire-eggs closed 4 years ago

fire-eggs commented 4 years ago

Looking at your sample code:

WHILE nums > 0 REPEAT
    PRINT a
    LET c = a + b
    LET a = b
    LET b = c
ENDWHILE

Are you missing a LET nums = nums - 1 statement? Otherwise it looks like the loop never ends.

AZHenley commented 4 years ago

You're right, thanks! Fixed.