Conway's game of life

The Game of Life (often called LIFE for short) is a cellular automata simulation that was invented by the British mathematician John Conway back in 1970. This sounds complex, but it's really quite simple—LIFE is a zero-player game that consists of a two-dimensional binary lattice of cells that are either considered live or dead. The lattice is iteratively updated by the following set of rules:

  • Any live cell with fewer than two live neighbors dies
  • Any live cell with two or three neighbors lives
  • Any live cell with more than three neighbors dies
  • Any dead cell with exactly three neighbors comes to life

These four simple rules give rise to a complex simulation with interesting mathematical properties that is also aesthetically ...

Get Hands-On GPU Programming with Python and CUDA now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.