Game of Life

By Omar Essilfie-Quaye

Github Repo Link to github repository Docs Link to source code documentation

Cellular Automata

The Game of Life, initially dubbed Life, was created by John Conway a British Mathematician and is talked about in Scientific American inOctober 1970. Life is an example of what is known as a cellular automata. Cellular automata are discrete simulations with a very basic rule set that can be used to study advanced mathematics. I personally enjoy how complex things can arise from such simple rules, some people have gone so far as to design miniature computers out the elements of the game of life.

Generally in cellular automata there is some grid type structure which can contain some form of life, which is usually denoted by a state. In the game of life this is 0 or 1, alive or dead, however this can take any number of possible combinations. Each cell can communicate with it's neighbouring cells, this can be just the immediate cells next to it, up, down, left and right or it can reach further out than that. This communication lets the cell figure out how it should change it's own state for the next generation which is dictated by the rules of the game. Due to the fact that the game can be run just by setting the initial states of all the cells with no further input it is known as a zero-player game.

Rules

The rules for state changes between generations in Life are shown below.

  • 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.

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.

Cool Creations

Various patterns in Life come up time and time again even when random initial conditions are used to start the game. These patterns can have many different behavioural characteristics and have been classed as such. Two of the most common types of behavioural patterns that occur are still life and oscillators.

Still Life

Still life, as the name suggests, remains unchanged between generations. There are a group of cells that are grouped together in such a patter that they remain stable and alive from one generation to the next. As long as no outside influence perturbs them, still life patters will persist indefinitely. Examples of simple still life patterns are shown below.

Block

Bee Hive

Boat

Loaf

Tub

Halo

Oscillators

Oscillators, like still life, remain active indefinitely as long as they are not disturbed. Unlike still life, however, oscillators do not remain unchanged between generations. An oscillator pattern will change between generations until it comes back around to it's starting pattern. The length of time if takes for an oscillator to return to it's initial condition is known as the period of oscillation and this can be as short as two generations or much longer. As far as I am aware there is no upper limit for the period of an oscillator. Simple oscillators with a period of two are shown below.

Beacon

Blinker

Toad