Project: Game of Life Simulation

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory  -  
[VID]sample.webm2026-04-09 17:11 223K 
[   ]gol.tar.gz2026-05-06 23:30 5.7K 

Background

Conway's Game of Life (often just Life) is a cellular automaton, which like Mandelbrot has simple rules, but complex effects. In fact, Life is Turing complete: the outcome of 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 ( x , y ) by considering all eight neighbors (that includes cells that only intersect with the current cell on corner points) and counting how many cells n ( x , y ) are alive. Depending on the current state of a cell and the number of live neighbors, we can determine if a cell remains alive, dies out (due to over- or under-population), is revived or remains dead:

s i + 1 ( x , y ) = { n ( x , y ) { 2 , 3 } if  s i ( x , y ) n ( x , y ) { 3 } otherwise

Interesting note (why x { y } and not just x = y ?) 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).

Overview of what to do?