Cellular Automata: Binary, Conway's Game of Life, Langton's Ant


Last edited:2018-04-21

Conway's Game of Life was my first implementation of a cellular automaton, which I started working on thanks to a suggestion of my programming teacher (who was also a high school student then). In the following months I also wrote implementations of binary or so-called elementary cellular automata, as well as Langton's Ant.

The rules of the Game of Life are very simple. The field is divided into cells that can each be either alive or dead. In order to compute the next generation (with the naive approach that I used), one must iterate over all cells of the new generation's field. Let L denote the number of living neighbors of the current cell.

  • A living cell…
    • dies if L < 2
    • dies if L > 3
    • stays alive if 2 ≤ L ≤ 3
  • A dead cell…
    • becomes alive iff L = 3

The video above is of my second version of the Game of Life. Below is a video of version 1. In both cases, I integrated all lifeforms I could find in this Life Lexicon.

I also wrote one version for LEGO Mindstorms NXT robots:

Langton's Ant has similarly simple rules:

  • If the current cell is marked, unmark it, turn right, and advance one cell.
  • If the current cell is not marked, mark it, turn left, and advance one cell.

Binary cellular automata are defined by an 8-bit bit vector. A more detailed explanation and helpful examples can be found at Wolfram MathWorld.

Links: Technologies used: