game-of-life-parsers

Crates.iogame-of-life-parsers
lib.rsgame-of-life-parsers
version2.0.1
sourcesrc
created_at2017-09-24 19:40:26.642806
updated_at2017-10-22 18:45:56.269191
descriptionCollection of parsers for Conway's game of life.
homepagehttps://github.com/Leopard2A5/game-of-life-parsers
repository
max_upload_size
id32972
size21,478
René Perschon (Leopard2A5)

documentation

https://docs.rs/game-of-life-parsers/

README

Game of Life parsers

Build Status Documentation

Collection of parsers for Conway's game of life.

Currently supported file formats:

  • Life 1.05
  • Life 1.06

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
    }
}
Commit count: 0

cargo fmt