Data structures for Conway's Game of Life
Add this to your project's dependencies in Cargo.toml
:
[dependencies]
gol = { git = "https://github.com/tlrobrn/gol" }
and this to your crate root:
extern crate gol;
use gol::{Grid, Point};
let point = Point { x: 5, y: 2 };
let mut grid = Grid::with_points(&[point]);
assert_eq!(Some(0), grid.age_of_point(&point));
grid.tick();
assert_eq!(None, grid.age_of_point(&point));
Run the following to generate and open the docs in your default browser:
$ cargo doc --open
$ cargo test
$ cargo build