Background
Conway's Game of Life (often justLife) is a cellular automaton, which like Mandelbrot has simple rules, but complex effects. In fact, Life is Turing complete: the
outcomeof the game is not decidable without simulating it.
Game of Life is a single-player game that takes place on
an infinite
square grid: Each square or cell
is either dead
( or ◻)
or alive ( or ◼).
For a given point in time, we refer to this as a configuration. Given
any state, we can compute the next, discrete configuration for each
cell
Interesting note (why and not just ?)
The slightly convoluted way to write down the rule
allows us to generalize Conway's Game of Life to an entire family of
Life-like
automata. In this schema, Game of Life is just
rule B3/S23 (born with 3 neighbors, survives with 2 or
three neighbours). If you have the time and interest, try playing around with
other variations and see how they affect your speedup!
Implementation
Here as well, we provide a a sequential implementation. To simplify
the implementation, the program writes out each generation as an
image. You can use FFmpeg to create
a video from this. The doit.sh script does this for you
from the template.
Note the additional difficulties here: The next state of each cell depends on that of it's neighbors — some communication is therefore necessary within the process topology you design. Additionally, we need finite means of representing an infinite plane. We avoid this issue in our template by reducing the plane to a torus (i.e. if you go over the right edge, you are teleported to the left edge; think of Snake).