Description
Was the code written and/or tested on a real physical Apple II only, or was an emulator also used?
Using LE
as a variable name causes issues with the parsing and becomes LET HEN
when LIST
ed. I have only tested this on a number of emulators and the result is the same - however, I can't test this on a physical machine (as I don't have access to one).
I assume that you didn't see this issue, because you tested it on a physical machine rather than an emulator (strange I know and they should both be the same) and on the physical machine the issue did not manifest itself?
Please see Does AppleSoft BASIC really parse "LE THEN" as "LET HEN"?.
Solution
As pointed out by this comment, the change was made here, #1 Change buffer to be used like a ring buffer. #5 and this Update snake.a #8 states that the calormen JS emulator was used, which seems to have a parsing bug, see LE THEN GOTO should be parsed as LET HEN GOTO #51.
The fix is to use parentheses around the LE
, changing
7010 IF LS > LE THEN GOTO 7060
to
7010 IF LS > (LE) THEN GOTO 7060
Alternative fixes
7010 IF LE < LS THEN GOTO 7060
or
7010 IF LS > LE GOTO 7060
Now the code will work on a real Apple II!
:-)