## Introduction

Though not John Conway's most important contribution to mathematics his game of life (GOL) is certainly his best known. The simplicity of the rules governing GOL and the surprising ways the patterns can evolve has attracted a great deal of interest. There is a wiki devoted to collecting GOL data, and which currently contains over 2000 patterns. These patterns are available as a free download from this page and are required by gol, the program described here.

## Gol Example

Figure 1. A screenshot from gol after the pattern (104P177) has been through 1000 generations. The surviving cells are shown in red and those born in the last generation in yellow.

gol is not a game, rather it is a simple GOL viewer: patterns are loaded and displayed on the screen and the program applies the GOL rules, updating the display for each tick of the clock. Please see Figure 1. and Worked Example 1.

In the display the board size depends on the pattern size and shape, and on the selected cell size. We distinguish surviving and born cells and as shown in Figure 1., they can have different colours. The delay between ticks or generations can be selected, though for very large numbers of cells the program's ability to keep to those times depends on the speed of the computer being used.

## Rules

The following has been copied from Wikipedia.

The universe of the Game of Life is an infinite, two-dimensional orthogonal grid of square cells, each of which is in one of two possible states, live or dead, (or populated and unpopulated, respectively). Every cell interacts with its eight neighbours, which are the cells that are horizontally, vertically, or diagonally adjacent. At each step in time, the following transitions occur:

1. Any live cell with fewer than two live neighbours dies, as if by underpopulation.

2. Any live cell with two or three live neighbours lives on to the next generation.

3. Any live cell with more than three live neighbours dies, as if by overpopulation.

4. Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.

These rules, which compare the behavior of the automaton to real life, can be condensed into the following:

1. Any live cell with two or three live neighbours survives.

2. Any dead cell with three live neighbours becomes a live cell.

3. All other live cells die in the next generation. Similarly, all other dead cells stay dead.

The initial pattern constitutes the seed of the system. The first generation is created by applying the above rules simultaneously to every cell in the seed; births and deaths occur simultaneously, and the discrete moment at which this happens is sometimes called a tick. Each generation is a pure function of the preceding one. The rules continue to be applied repeatedly to create further generations.

## gol Worked Example 1

The worked example initially shows the plotting of pattern 104P177 using red for survived and yellow for born cells; then the user clicks the pause button and changes the born colour to red; afterwards she clicks the pause button to continue plotting. 104P177 repeats after 177 generations.

## Gol Pattern Selector

Figure 2. A screenshot of the gol Pattern Selector window which contains a scrollable list of Pattern names. Patterns are selected by clicking on their name and then clicking the "Text" or "Plot" buttons at the top of the window. The number at the base of the window shows how many patterns were loaded.

## Using gol

The program starts by displaying a blank board and a scrollable list of pattern names. The top of the scrollable list has two boxes labelled "Text" and "Plot". Patterns are selected by first clicking on their name and then clicking on "Text" or "Plot". The first of these simply displays a box of text containing the description from the RLE file and the second starts plotting each generation of the pattern on the board.

The generations are separated by a fixed delay. Plotting will continue until "Max Ticks" have occurred or the pattern does not change between consecutive ticks, or if stopped by the user.

At the top of the board is a jigsaw puzzle symbol containing a menu. Menu options include:

"Edge Wrapping" which determines if the cells at the edges of the plot wrap around or are treated as dead.

The plot will stop after "Max Ticks".

Cells in the plot are of "Cell Size" pixels.

The initial pattern is drawn surrounded by "Margin Size" number of blank cells.

If the selection mode is "Random" each pattern will be plotted for "Max Animation Time" seconds.

"Delay" is the time between ticks in milliseconds.

"Max Cells" limits the size of the patterns loaded. Some of the patterns in the downlaod are larger than available screens, and also a few patterns have very many cells. For most desktop machines, gol would not be fast enough to display these patterns at reasonable speed. The number of patterns loaded is shown at the base of the pattern selector box.

"Set Colour" enables users to choose colours of the plotting surface, the born and the survived cells.

If the "Selection Mode" is set to "Random" the program will display randomly selected patterns until it is stopped. Otherwise it will expect the user to select individual patterns using the Pattern Selector.

The menu also contains a Help option and a "Save Settings" option for saving the current configuration.

Next to the jigsaw symbol is a button which starts the plotting of a randomly selected pattern. To its right is a pause button which will stop and restart the current plot. To its right is a stop button. Next is the name of the currently selected pattern (this box cannot be used to input names). To its right is a counter which increments for each tick.

## Patterns

To use gol you need to download the pattern files (from here) and unzip them. The download includes two copies of the patterns, one in RLE format and the other in plaintext. Only the RLE files are used by gol and they should be copied to the default location which is your equivalent of /home/me/.pzl/gol/RLE/ (where "me" is your username).

gol stores the location of the pattern files in its configuration file. But this configuration file will not exist until the user executes the "Save Settings" option. Consequently when the program is started for the first time, the configuration file will not exist, and so gol uses the default location mentioned above. If this is where you have copied the patterns to, that is all that is required and the Pattern Selector list will be populated and gol is ready to use. If you want to store them somewhere else you need to do the following.

Start gol.

Save Settings to create a configuration file (.pzl/gol/preferences.txt).

Edit .pzl/gol/preferences.txt to replace the line

pattern_files /home/me/.pzl/gol/RLE

with the location of your RLE files.

Restart gol and it should populate the Pattern Selector. If it doesn't you've made an error.

Please note that nowhere else in all the pzl games do users need to use an editor to alter a configuration file, and here it is only if they have some pressing reason to store the RLE files in a place other than expected. Configuration files are replaced each time a user employs the "Save Settings" option.

The download includes some patterns which do not produce interesting animations but which may be selected by the program's random modes.

The first class of such patterns are so-called Still-Lifes, eg 15bentpaperclip which do not change from one generation to the next. Unsurprisingly, such patterns produce a static display.

The second are patterns which are only components of more complex patterns and which cannot exist in isolation, such as Orthogonal_on-off which is an on-off rotor. One tick and the cells are all dead or "off" and the display is empty.

## gol Worked Example 2

The worked example shows the plotting of pattern linemendingreaction. Notice that the plotting stops once the pattern stops changing. Obviously patterns like the 104P177 shown in Example 1 could carry on indefinitely so gol has a "Max Ticks" option to limit such patterns.

pzl

# gol

• Double-click any word to get its definition

• 2024-07-13