by C1sc0cat · 6y ago · 0 comments
I am a bit rusty but this sows the problem:
10 L = 4720 FOR I =1 TO 1000 STEP 2
30 PRINT I%
35 IF I = l GOTO 6999
40 NEXT
6999 STOP
What you needed to do was set I to the end condition as part of the break out of the loop.
There was also a lot of aggressive compression done to reduce program size PET in particular munged every thing up putting as many statements on one line as possible
ON X GOTO 200,300,400,500 depending if x=1, x=2,x=3...
They'd obviously used the same parser for the standard "If a=1 then goto 200" construct, which allowed an undocumented shortcut of "If a=1, 200" which a few people noticed and started using. However, a later model fixed this, which broke a number of programs.
IF a=1 THEN 200
and when they added ON..GOTO, they basically made these two mirrored syntactically. So you could do: IF a=1 GOTO 200
ON a THEN 100,200,300
(I suspect it was simply treated as identical token?)I could have Told BillG that was bad idea back when I was 19
x = x + (x < 5)
:DNo If needed.
Atari Basic would allow crazy things like:
10 Goto ((x < 5)*100) + 50
Goes to either line 50 or 150, depending on the comparison result being 1, or 0)Or...
Goto (100*x)
Faster On goto with no checking, lol.Bill Gates was not involved with the original Atari Basic. That could be purchased on a cartridge for running MS Basic programs.
10 is always CLS