Conway's Game of Life
according to wiki, the game is a zero-player game, which start from its initial state and evaluate to its death or infinitely.
the game is on an infinite, two-dimensional orthogonal grid of square cells, but here we are running it on a finite grid. A cell is in one of two possible states, alive or dead. Every cell interacts with its eight neighbours, which are the cells that are horizontally, vertically, or diagonally adjacent. At each step in time, the following transitions occur:
- Any live cell with fewer than two live neighbors dies, as if by under population.
- 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 three live neighbors becomes a live cell, as if by reproduction.
. ├── Cargo.lock // depencies lock ├── Cargo.toml // project config ├── README.md ├── src // source diretory, source code goes here │ ├── lib.rs // the game its self, as a library, │ └── main.rs // the binary to load the game from a configuration file └── tests ├── error_state.txt ├── initial_state.txt └── integration-tests.rs // integration tests go here (unit tests go in each file they're testing)
make sure your
rustup is setup correctly
git clone https://github.com/jonirrings/conway_s_game_of_life.git cd conway_s_game_of_life cargo run --release