pub trait CellularAutomata<'a, CellDataType> {
fn run(&mut self, _: &'a str);
fn new() -> Self;
fn input_handler(_: &mut Grid<'_, CellDataType>, _: &Reader, _: &Printer);
fn output_handler(_: &Grid<'_, CellDataType>, _: &Printer);
}
Expand description
Trait CellularAutomata is a trait that all cellular automata must satisfy
Required Methods
sourcefn input_handler(_: &mut Grid<'_, CellDataType>, _: &Reader, _: &Printer)
fn input_handler(_: &mut Grid<'_, CellDataType>, _: &Reader, _: &Printer)
Function input_handler takes the grid and a reader and modifies the grid according to what it reads. The printer argument is there just so the automata can prompt the user (if needed)
sourcefn output_handler(_: &Grid<'_, CellDataType>, _: &Printer)
fn output_handler(_: &Grid<'_, CellDataType>, _: &Printer)
Function output_handler takes a grid and a printer and prints out something, according to the data of the grid.