Latest update Dec 3, 2013

To avoid spam, all mail addresses on this page have the "@" replaced by "#".

Conway's Game of Life

One or two persons, level of ambition accordingly. Experience with some simple .NET GUI programming is an advantage.

Conway's Game of Life is a well-known cellular automaton. The cells are points in a 2D grid. Each cell can be either alive or dead. Cells have their state updated according to the following rules:

The game is started with some configuration of dead and alive cells. For many initial configurations, the population of cells will develop in interesting ways: expanding, shrinking, moving, etc. For other starting configurations, the population will soon die out.

The task of this project is to implement a graphical version of Conway's Game of Life. The "world" is a 16x16 grid, where a dead cell is shown as a white square and a live cell as a black square. The user should be able to set the initial configuration by clicking on cells, toggling its state for each click. It should be possible to set the number of steps to run the game, including "infinity" to have the game running until externally interrupted. With one button, the game will be started and run for the specified number of steps. Another button will single-step the game. In-between each single step, the user should be able to modify the configuration. There should also be a button to set the configuration to all cells dead.

The above is sufficient for one person. For two persons, the following additional functionality is required:

The code should be "functional style", which means that the use of side-effects should be minimized. You will need to somehow keep the current state of the cell grid, of course. Think carefully about which kind of data structure(s) you will need to represent the grid, and design your operations on the grid as functions on this data structure.

Hint: the "break button" probably requries some simple asynchronous programming, and event handling. We have not covered this in the lectures, so you will have to find out by yourself how to do it.

For some further information and inspiration, see the Wikipedia.

Viewable With Any Browser

Björn Lisper