Crate rlifesrc_lib

Source
Expand description

Rust Life Search, or rlifesrc, is a Game of Life pattern searcher written in Rust.

The program is based on David Bell’s lifesrc and Jason Summers’s WinLifeSearch, using an algorithm invented by Dean Hickerson.

Compared to WinLifeSearch, rlifesrc is still slower, and lacks many important features. But it supports non-totalistic Life-like and Generations rules.

This is the library for rlifesrc. There is also a command-line tool with a TUI and a web app using WebAssembly.

You can try the web app here.

§Example

Finds the 25P3H1V0.1 spaceship.

use rlifesrc_lib::{Config, Status};

// Configures the world.
let config = Config::new(16, 5, 3).set_translate(0, 1);

// Creates the world.
let mut search = config.world().unwrap();

// Searches and displays the generation 0 of the result.
if let Status::Found = search.search(None) {
    println!("{}", search.rle_gen(0))
}

Search result:

x = 16, y = 5, rule = B3/S23
........o.......$
.oo.ooo.ooo.....$
.oo....o..oo.oo.$
o..o.oo...o..oo.$
............o..o!

Re-exports§

pub use search::Status;

Modules§

rules
Cellular automata rules.
saveserde
Saves the world.
search
The searching algorithms.

Structs§

Config
World configuration.
KnownCell
A cell whose state is known before the search.
State
Possible states of a known cell.
World
The world.

Enums§

Error
All kinds of errors in this crate.
NewState
How to choose a state for an unknown cell.
PolyWorld
A polymorphic World.
SearchOrder
The order to find a new unknown cell.
Symmetry
Symmetries of the pattern.
Transform
Transformations (rotations and reflections) after the last generation in a period.

Constants§

ALIVE
The Alive state.
DEAD
The Dead state.

Type Aliases§

Coord
The coordinates of a cell.