Diana's Domain






This page was last updated June 18th, 2017.

Conway's Game of Life


Controls:

Play the GAME OF LIFE!

More Info:

Introduced in a 1970 Scientific American column, John Conway's Game of Life is a popular cellular automata 'game' in which the survival of a living cell on the grid is determined by the states of its neighboring cells. One could play the game using graph paper, a pencil and eraser, and oodles of patience.

The logical rules governing the state of each cell at each step are as follows:

  1. If a cell is alive and fewer than 2 of its neighbors are alive, that cell dies. (analogy: death by isolation)
  2. If a cell is alive and exactly 2 or 3 of its neighbors are alive, that cell remains alive. (analogy: happy cell)
  3. If a cell is alive and more than 3 of its neighbors are alive, that cell dies. (analogy: death by overpopulation)
  4. If a cell is dead and exactly 3 of its neighbors are alive, that cell becomes alive. Dead cells otherwise stay dead. (analogy: three-way mating?)

These simple rules happen to result in complex emergent behavior across iterative generations. Watch a cosmic dance of life and death unfold amongst the squares!

This basic implementation is written in Javascript and uses p5.js. The 'trails' which appear at various opacities were unintentional and come about as a consequence of how p5 updates the drawn graphics. Though accidental, they make for interesting patterns and give this implementation of a famous cellular automata its own funky flair.

This implementation is non-infinite, meaning the imaginary cells just past the four edges of the screen are treated as being dead no matter what. The number of cells which make up the playing field depends on the size of your browser window.

View the code here.

Cool Starting Patterns:

Try filling the cells in as some of these patterns and pressing the Spacebar to see what happens!

Page numbers have been cited for some patterns as found in the 2013 Dover edition of William Poundstone's The Recursive Universe.

Glider

The glider moves diagonally across the screen. They often arise "naturally" during random play. The pattern shown here will move southeast while mirrored versions will move in other directions. Incidentally, also the logo of the Bard CS department.



T Tetromino

A tetromino is built of four squares. This T pattern results in what is called a "traffic light." Poundstone, 28.




R Pentamino

The R pentamino is a good example of a small starting pattern which produces lots of subsequent activity. Early Life researchers discovered that it does not settle into a stable pattern (with six gliders moving outwards infinitely) until the 1103rd iteration. Poundstone, 33.


Pulsar

There are a couple of ways to produce a pulsar; the one to the left is as good as any. The pulsar oscillates through 3 phases. A gif of a pulsar in oscillation is shown on the Projects page. Poundstone, 42.



Figure 8

An oscillating pattern with 8 phases. Poundstone, 43.





Pond-Forming Glider Collision

The pond is a "still-life" stable pattern and will remain as is unless disturbed. One way to form a pond is by colliding two gliders as shown. The glider on the right is at a different time-step than the left one, hence the pattern is slightly different. This pattern is featured because it is stated on a gif explanation page that most digital circles do not just arise out of primordial pixel goo—the Game Of Life pond is perhaps an exception. Poundstone, 83.


Lightweight Spaceship

A spaceship moves horizontally or vertically (a.k.a. orthogonally) across the screen. The 4-cell bottom row of the lightweight spaceship can be expanded by 1 or 2 cells to form the middleweight and heavyweight spaceships respectively. A spaceship moves at half the "speed of light," the speed of light being one cell per iteration (the fastest speed at which information can move in the Game of Life). Hence the spaceship moves one cell every other iteration. Poundstone, 80.



Straight Runs

My personal favorite patterns are simply what arises when straight runs of varying numbers of squares are set down horizontally or vertically. The results are symmetrical and change depending on the length value. A horizontal run of 8 squares is shown to the left.

These patterns tend to get cooler the more cells they involve. I usually just drag a straight selection of a bunch of cells across the screen without actually counting. That being said, 49 cells in a row makes a long running pattern which is particularly fun to watch while 41 cells in a row ends delightfully. Once the length value becomes sufficiently large many of the patterns will collide with the boundary of the screen space (which is dependent the size of the browser window, and hence also the size of your device's display) so it is best to try this in a vertical arrangement down the middle of the playing field.


Spiral Runs

Another sort of configuration which results in cool symmetrical patterns is a straight run of cells with diagonal arms coming off the ends. Again, the number of cells in both the straight run and the diagonal run makes a huge difference in the result. To the left is shown a starting pattern with 11 cells in the straight line with 3 cell diagonal spiral arms.




Symmetry Breaking Runs

Making a straight run of cells and then setting 3 extra cells of one end to be like the configuration shown will cause a pattern with symmetry limited to one axis.