Expand description
Game of Life
Library to manage the grid state for Conways game of life.
See: https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life
use gridlife::Grid;
let mut grid = Grid::new_random(3, 3);
let mut population = grid.population;
// Run the rules of Game of Life until the population count stabalizes
loop {
grid.update_states();
let next_pop = grid.population;
if next_pop == population {
break;
}
population = next_pop;
}
Structs§
- Grid
Grid
holds the state for a Conways game of life
Enums§
- Cell
State CellState
models whether a cell has an alive or dead population