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.