The Game Of Life
Introduction
For this project, I recreated Conway's Game of Life. The game involves a grid of cells, where each cell is either "dead" or "alive". In this version, white cells are considered "dead", while the black cells are "alive". The rules for the game are as follows:
- Any live cell with two or three live neighbors survives.
- Any dead cell with three live neighbors becomes a live cell.
- All other live cells die in the next generation. Similarly, all other dead cells stay dead.
In this game, the neighbors are the 8 adjacent cells. One important note is that each iteration is evaluated simultaneously. There are also a few key areas that can be optimized to allow for much larger grid sizes and larger starting populations. For example, we only need to track living cells, since dead cells can only be revived by living cells. I also optimized the lookup of neighbors by implementing a QuadTree data structure.