Crate game_of_life_parsers [−] [src]
Collection of parsers for Conway's game of life.
Currently supported file formats:
- Life 1.05
Usage
extern crate game_of_life_parsers; // use std::fs::File; use game_of_life_parsers::{Parser, Life105Parser}; fn main() { // let file = File::open("file.life").unwrap(); let file = "#N\n#P 0 0\n..*".as_bytes(); let mut parser = Life105Parser::new(); let game_descriptor = parser.parse(Box::new(file)).unwrap(); for live_cell in game_descriptor.live_cells() { // iterate overe live cells } }
Modules
errors |
Error types generated by |
Structs
Coord |
Represents the coordinates of cells. |
Life105Parser |
Parser for files in the life 1.05 format. |
Life106Parser |
Parser for files in the life 1.05 format. |
Traits
GameDescriptor |
Describes the initial state of a Game of Life. |
Parser |
Specifies a common interface for all game of life parser implementations. |