Septemberís program, Runner, is nostalgic for me. When I wrote this program I had moved on to my C64. My ZX81 was starting to gather dust as I was busy learning the ins and outs of my new computer. For some reason, something tugged at me to fix my ZX81 keyboard and get it running again. After transplanting the ZX81 brains into a TS1000 case, it surprisingly powered on. I wrote Runner as a test that still worked. It did. That was the last time I was able to use the computer that had been my pride and joy for the previous three years.
The program itself isnít very exciting. It is a short and simple animation of a figure running across the screen. The runner isnít the best of my animations. Iím not quite sure what the end display is. It looks like the sun. Since I didnít have my printer connected, I wrote the program down in my programming journal. Some of the characters were illegible which caused me to guess and change the program a bit. Overall the program is pretty faithful to the original.
As I look at the code, I see some functions and logic that I rarely used. The runner is actually housed in three strings. The first string is the head, the second the body, and the third the legs. The animation is two-fold. One variable moves the runner across the screen. Another determines which cell to display. The program displays the each cell using the cell variable by printing specific parts of the strings mentioned earlier. Although the animation isnít the best, the display routine is solid. Iíve used that logic before, but not as often.
VAL statement was the other item of interest. In ZX81 BASIC, you can save code in a string and then execute that string using
VAL. In this case, I used it as a delay routine to slow down the animation. What is intriguing is that you could use that logic to create dynamic routines. That is a pretty powerful statement that I donít remember being used much in programs back then. Iíve personally used that dynamic logic often in various Perl programs Iíve written. Iím now curious how that logic could be used to create more complex ZX81 programs.
Hope you enjoy Septemberís program. As always, Iím interested in your programming or computer experiences. Please share!
If you want to run this program on your Android phone or tablet you can download a compressed copy of the program to your device. Youíll need to save the .p version of the program to your device to allow Zed Ex (Beta) to run it.