Volume 2, Number 3 – July 1982

Page 32 of 37


by P. Whittaker

The last issue of Micropower contained a hex dump of a machine code program headed “Coordinate Life”. This article is an attempt to describe what the program does, how it does it, and how to use it.

Life, the computer version that is, has been around for several years now. It plots the evolution of a colony of cells which obey a set of simple rules. By changing the rules you can produce wide variations in the behaviour of the colony, but the rules first published by J. H. Conway seem to produce the most interesting patterns. Conways rules are:–

  1. The cells occupy a rectangular array (like the squares of graph paper), and each cell has 8 neighbours
  2. Each cell is in one of two possible states, alive or dead!
  3. If a living cell has no live neighbours, or only one, it will die in the next generation
  4. A living cell with four or more live neighbours will die in the next generation through overcrowding
  5. An new cell will be formed in the next generation on any empty cell with exactly three live neighbours.

Although you can follow the evolution of simple patterns with pencil and paper, it is much easier, and more interesting, to use a computer to display the complex behaviour that can be produced by these simple rules. However, whatever the size of the display selected, the most fascinating patterns always seem to become too big for the screen. For example, using Pixel graphics the Nascom screen can only display a 96 x 48 cell array, and many patterns soon expand beyond these limits.

You can overcome the problem of a small display size by letting the screen act as a window into a larger array. by using the cursor keys to move the window asound you can inspect any part of the array at will. You then run into another problem – the memory capacity needed by a large array. If each cell is represented by one byte, a 100 x 100 array would need nearly 10K of memory. Even if each cell was represented by the state of a single bit, an array 1000 x 1000 would need more memory than the Z80 is capable of addressing.

This program overcomes the capacity problem by only storing the coordinates of the living cells. Because in any colony the proportion of active cells is small, and tends to decrease as the total population grows (i.e., the area covered by the colony increases faster than the population), you can store the coordinates of the active cells in quite a

Page 32 of 37