Iíve been a bit busy this month so I choose a relatively short program in order to not miss my self imposed deadline. To that end, I present to you Aprilís belated graphic program: Sphere. This program will easily run on a 2K ZX81. With some trimming, if you are so inclined, it will probably run in the original 1K of RAM as well. Although I doubt too many people with a ZX81 have less than 16K of RAM. Take a look at the listing to get a feel for how small this program really is.
If memory serves me right, I believe this program is based on a PC program from a book I was reading. I converted the listing to ZX81 Basic and then waited. Did I say wait? I mean like start it, go take a shower, trip to the store, walk around the block, and then maybe, just maybe, it will be finished. The ZX81 may have some nice math functions, like
COS. However, they are very slow. In order to speed things up a bit, this program is best run in
FAST mode which forgoes updating the screen. To compensate, you can press a key to pause the display after each plot.
I modified this program from the original printed version. I added a
REM to the top with a title. I converted it to use the built in
PI function. I'm not sure why I originally had a
LET statement to set
PI, but the built in function works just fine. I added a
PAUSE after each internal loop just so you know the program is still running. And lastly, I added some lines to manage the manage run on load as well as to turn
FAST mode on and off.
Overall, this is a pretty straight forward program that demonstrates nicely just how far computing has advanced since 1981.