Little project which implements Conway's Game of Life.
The API doc of the whole crate is here.
To buid the game you need Rust and Cargo installed. Then type:
cargo clean
cargo test
cargo build --release
Then you can invoke the game with:
./target/release/game_of_life -h
To see the available options or without -h
to run it with defaults.
There are four simple rules when a living cell dies or a new cell will be born:
C
living cellN
neighbour cellx
died cell
A cell dies if it has < 2 neighbours:
C -> x
or
CN -> xN
A cell survives if it has exactly 2 or 3 neighbours:
CN -> CN
N N
or
NCN -> NCN
N N
A cell dies if it has > 3 neighbours:
N N
NCN -> NxN
N N
or
NNN NNN
NCN -> NxN
NNN NNN
A new cell is born at an empty place, if this place has exactly 3 neighbours:
C -> CC
CC CC