Skip to main content

Posts

Showing posts with the label C

Magnetic fridge poetry in C for retrocomputers (RC2014, ZX Spectrum)

F ollowing a house move I reinstalled these fridge magnets and found myself organising them by type (noun, verb, adjective etc). Naturally thoughts turn to writing a program to pick the words at random. As this involves a lot of string handling, it's a perfect candidate for using C and I've been looking for an excuse to try C for my RC2014 and possibly other 8-bit computers too. I found the z88dk to be perfect, very easy to get up and running, a nice workflow with the zcc command and cpm target. Here's the very satisfying result after a little work. It occurred to me that the same program should build for other targets that the z88dk supports ( which is many ) In fact it wasn't that simple. I had to change the code a bit to allow it to run on a Spectrum. But one bonus is that you can choose to build with a proportional font option, which looks really nice on the Speccy and suits this program well. One of the issues I had was getting something random to seed the rnd func...