For this exercise you will create an implementation of Conway’s Game of Life. The Game of Life consists of a grid of square cells, each of which is in two possible states, alive or dead. Every cell interacts with its eight neighbors, which are the cells that are horizontally, vertically, or diagonally adjacent.
Each turn in the game is a new generation of cells. At each generation the following changes occur:
- Any live cell with fewer than two live neighbors dies, as if by underpopulation.
- Any live cell with two or three live neighbors lives on to the next generation.
- Any live cell with more than three live neighbors dies, as if by overpopulation.
- Any dead cell with exactly 3 live neighbors becomes a live cell, as if by reproduction
The rules can be summarized into the following:
- Any live cell with two to three neighbors survives.
- Any dead cell with three live neighbors becomes a live cell.
- All other live cells die in the next generation. All other dead cells stay dead.
The game is started with a seed that defines the state of each cell in the grid. The first generation is created by applying the rules simultaneously to every cell in the seed. The rules continue to be applied repeatedly to create further generations. The final product of the exercise should include:
- The ability to set the initial seed for the game.
- A UI that displays the current generation of the grid.
- A UI affordance for advancing the game one generation at a time.
- The grid must be at least 10 columns and 10 rows. The exercise should be completed as a working iOS app.