Chapter 6
All That Work for one Line?We shouldn’t complain too loudly. It works, and no one said creating graphics was easy.
Our current “universal” program can only handle one line of DATA, and it’s becoming increasingly apparent that
15 ONERR GOT0 900
130 PRINT : GOT0 20
Line 130 creates an infinite loop, sending execution back to the READ statement after printing each line.
Line 15 gives the program a smooth ENDing when the DATA is all READ. When there is no more DATA, an
Let’s add 2 more lines of DATA to see how it works:
1 0 0 0 | D A T A 4 9 , - 8 , 0 , 3 , 1 5 , 6 3 , - 3 4 , 0 , 6 3 , 1 5 , 3 , 0 |
1 0 1 0 | D A T A 4 9 , - 7 , 0 , 6 3 , - 3 , 1 2 7 , 7 , - 3 2 , 0 , 7 , - 3 , 1 2 7 , 6 3 |
and RUN.
Figure
It sprouted flowers!
54