cellular-automata-rs 0.1.0

Elementary cellular automata (Wolfram rules 0-255), Conway's Game of Life, Langton's Ant, and cyclic automata in pure Rust
Documentation
  • Coverage
  • 95.6%
    87 out of 91 items documented5 out of 59 items with examples
  • Size
  • Source code size: 52.7 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 921.44 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • SuperInstance/cellular-automata-rs
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • SuperInstance

cellular-automata-rs

Research-grade cellular automata library in pure Rust.

Features

  • Elementary cellular automata: All 256 Wolfram rules with configurable width and wrapping
  • Conway's Game of Life: Arbitrary grid sizes with configurable neighbor rules
  • Langton's Ant: Multiple ant support and color variants
  • Cyclic automata: Configurable state count and neighborhood range

Usage

use cellular_automata_rs::elementary::ElementaryCA;
use cellular_automata_rs::life::GameOfLife;
use cellular_automata_rs::langton::LangtonsAnt;
use cellular_automata_rs::cyclic::CyclicCA;

// Elementary CA - Rule 110
let mut ca = ElementaryCA::new(110, 79);
ca.set_single_center();
let state = ca.step();

// Game of Life
let mut gol = GameOfLife::new(20, 20);
gol.set(10, 10, true);
gol.step();

// Langton's Ant
let mut ant = LangtonsAnt::new(50, 50);
ant.step();

// Cyclic CA
let mut cyclic = CyclicCA::new(40, 40, 4);
cyclic.randomize();
cyclic.step();

License

MIT OR Apache-2.0