More than a game: the Game of Life


English: Diagram from the Game of Life
English: Diagram from the Game of Life (Photo credit: Wikipedia)

Conway’s Game of Life has long fascinated me. Thirty years ago I wrote some Z80 machine code to run it on a Sinclair ZX80 and when I wrote BINSIC, my reimplentation of Sinclair ZX81 BASIC, Life was the obvious choice for a demonstration piece of BASIC (and I had to rewrite it from scratch when I discovered that the version in Basic Computer Games was banjaxed).

But Life is much more than a game – it continues to be the foundation of ongoing research into computability and geometry – as the linked article in the New Scientist reports.

For me, it’s just fun though. When I wrote my first version of it back in 1981 I merely used the rubric in Basic Computer Games – there was no description of gliders or any of the other fascinating patterns that the game throws up – so in a sense I “discovered” them independently, with all the excitement that implies: it is certainly possible to spend hours typing in patterns to see what results they produce and to keep coming back for more.

  • “Life.bas” should run on any system that will support the Java SDK – for instance it will run on a Raspberry Pi – follow the instructions on the BINSIC page. A more up to date version may be available in the Github repository at any given time (for instance, at the time of writing, the version in Git supports graphics plotting, the version in the JAR file on the server only supports text plotting). On the other hand, at any given time the version in Git may not work at all: thems the breaks. If you need assistance then just comment here or email me adrianmcmenamin at gmail.

Back from the dead (almost)


hexmon BASICThe graphic you can see here is the partially recovered code of a program I wrote thirty years ago – “hexmon” – to display chunks of ZX80 memory in hexadecimal format (at least I think that’s what it did).

I am determined to fully recover it – but as you can see it works well so far and the machine code string in the middle looks particularly good – especially as I can see it ends with C9 which I know is the Z80 “return” command.

First bit of assembler


Z80 architecture
Image via Wikipedia

According to my diary for 22 March 1981 – this is the first piece of working assembler (actually it was Z80 machine code as there was no assembler program) I wrote:

LD IX(400Ch)
INC IX
LD HL, 402Bh
LD B, 0Ah
LD A (HL)
LD (IX + 0), A
INC HL
INC IX
DJNZ
RET

I think it became part of a bigger “Hexmon” program to display chunks of internal memory on screen.