Lifeforms - The Ultimate Game of Life
by RichardTaylor

Running the !Life application opens up a directory window containing the '!LifeForms' application, and two directories containing example grid files and rule files. Instructions for using LifeForms follow.

Imagine a square grid of cells, each of which may be of a different state, represented by a colour. As every generation passes each cell may change to a new state or stay the same depending on a certain set of rules. These rules can be set individually for each state, and depend on the cell's immediate neighbours in the grid. Such a system is called a cellular automaton and it can best be described using the famous example of John Conway's 'Game of Life' - to which this program defaults.

In 'Life' each cell has just two possible states: either living or dead. A dead cell becomes alive if exactly three of its eight neighbours in the square grid are already alive. However, a cell can die of either isolation - if it has less than two living neighbours, or of over-crowding - if four or more of the surrounding cells are alive. This cleverly balanced set of rules can produce an enormous variety of life-forms, indeed this whole article could be spent describing them. However, using the application, these default conditions can themselves be altered, to produce a myriad of other types of cellular automata. How this is done will be described later.

USING THE APPLICATION
Double-click on the !LifeForms icon, and it will install itself on the icon bar, as a standard Wimp task. Clicking Menu on this icon will show the standard Info and Quit options while Select will bring up the Tools Window and the Grid window containing an empty 30x30 cell grid. The program can cope with up to sixteen states (s0-s15), though it defaults to the 'Life' rules, which were explained above. Select either the 'dead' state s0 (mid-grey) or the 'living' state s1 (blue) from the selection box in the middle of the tools window. Then click on any cell in the grid to change it to that state, as you would use 'Paint'. To start with, try the 'glider' shape which is featured in the application's icon or the 'blinker' which consists of three cells in a row. Then click on the Start Icon and watch the result. Notice the generation counter which indicates the number of times the whole grid has been tested and updated where necessary. Use the Stop Icon to halt the process. You will soon find many other configurations that produce equally interesting results, and some of these are included as LifeForm Grid files on the disc.

The size of the grid can be altered by adjusting the Size value which is next to the generation counter. Use the Store Icon to put the current grid into memory (and reset the generation counter), and the Restore Icon to recover it. Note the grid is always stored automatically when the process is started from generation zero. The Clear Icon wipes the grid to the currently selected state, and clicking on the Random Icon produces a randomised grid using all the states up to and including the current one - this is useful for 'Demon' type cellular automata. The Step value and the Execute Step Icon allow the process to be moved on for the specified number of generations.

DEFINING THE RULES
The Count Mode defines which neighbouring cells are counted when deciding whether the state of a cell should change. The 'Four-Mode' only uses the cells which are to the left, right, above and below. 'Eight-Mode' counts them all, including diagonals, and 'Nine-Mode' includes the central cell itself in the counting. This applies to the rules for all states. However, beneath the state selection box are the rules which will apply only to the currently selected state. The first changeable box, surrounded by arrows, defines when the cells of that state change. The meanings of 'Never' and 'Always' are self-evident, and 'Conditionally (1)' and 'Conditionally (2)' depend on further rules which are explained below. As long as 'Never' has not been selected, the state to which the cell changes (when the conditions are satisfied) can be altered in the next box. Note how different words are greyed if they are irrelevant.

If 'Conditionally (1)' or 'Conditionally (2)' is selected then the row of three boxes specify precisely the conditions under which a cell of the currently selected state changes. When a cell of this current state is encountered by the program, a count is made of the number of neighbouring cells which are of the state indicated in the middle of the three boxes. The number of surrounding state three cells may be called 'n3', and the number of neighbouring s5 cells, 'n5', and so on. If the number of cells counted is greater than or equal to the number to the left (the first box in the row) and it is less than or equal to the number to the right then this condition is said to be TRUE. If 'Conditionally (2)' is selected then the second row of three boxes have a similar function. (But if 'Conditionally (1)' is in operation this second condition is automatically given the value of FALSE.) These two results are combined using the logical connective that is specified in the next box. If this overall condition is TRUE then the cell will change to the state specified.

This probably sounds a lot more complicated than it is. If we return to the default example of the 'Game of Life' explained above, the way these rules work can be seen more clearly. Click on state s0 in the state selection box. You will see that cells of state s0 (dead) change to state s1 (alive) if they are surronded by exactly three State s1 cells. Now click on state s1 in the selection box. The 'sentence' that you can see reads:
    "s1 conditionally (2) changes to state s0 if surrounded by:
    0 <= n1 <= 1    4 <= n1 <= 8    Logic : 'or'"

Translated into English this means that cells of state s1 change to state s0 if surrounded by 0 or 1 state s1 cells OR 4 to 8 state s1 cells. So this time there are two conditions (isolation and overcrowding as mentioned earlier) - if either is satisfied the cell will die (change to State s0). 

The colour box marked 'Col' allows you to change the colour of the currently  selected state. When you have decided on the colour, click on the Set  Icon, to update any cells of that state in the grid. Finally, the writeable icon at the bottom allows a description of the current automata to be entered, to a maximum length of over 800 characters. Pressing Menu over the grid or tools window allows you to save the current rules or grid. Note that if the grid is saved the rules are saved as well. These files can be re-loaded later in the normal way.

You may notice that where a lot of cells are changing in each generation the speed is slowed significantly. This may be more noticeable with different rules. Unfortunately, as the application has to cater for a lot of possible sets of rules, and is not dedicated to one type of cellular automaton, and since it must deal with the problems of overlapping windows posed by the Wimp environment, it is not particularly fast. To overcome this, you can change the grid size to the minimum needed, or alternatively change the view of the window to just the area of interest.

The disc includes a number of LifeForm rules for different cellular automata, including 'WireWorld' where 'electrons' flow along 'wires' and 'Demons' where order is produced from the chaos of a random grid. There are also some example grid files showing these rules in action If you do come up with some interesting rules - and the possiblilities are endless - please send them in. I hope this has given you a brief introduction to a most fascinating topic. For those who are interested some further reading is listed below.

1. Wheels, Life and Other Mathematical Amusements, by Martin Gardner (1983), W.H. Freeman and Company.
(This book contains three large chapters on everything to do with 'The Game of Life' that Martin Gardner had covered in his Mathematical Recreations coloumn in the Scientific American.)

2. Computer Recreations, by A.K. Dewdney, in Scientific American, Vol.261, No.2, August 1989, pp.88 to 91, 
(explains the rules to the 'Demon' cellular automata).

3. Computer Recreations, by A.K. Dewdney, in Scientific American, Vol.262, No.1, January 1990, pp.136 to 139
    (covers 'WireWorld' and the component and circuits that can be produced using it).
