Crates.io | game-of-life-parsers |
lib.rs | game-of-life-parsers |
version | 2.0.1 |
source | src |
created_at | 2017-09-24 19:40:26.642806 |
updated_at | 2017-10-22 18:45:56.269191 |
description | Collection of parsers for Conway's game of life. |
homepage | https://github.com/Leopard2A5/game-of-life-parsers |
repository | |
max_upload_size | |
id | 32972 |
size | 21,478 |
Collection of parsers for Conway's game of life.
Currently supported file formats:
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
}
}