16 releases

0.6.1 Mar 18, 2023
0.6.0 May 1, 2022
0.5.2 Jan 1, 2022
0.5.1 Jul 17, 2021
0.2.0 Nov 30, 2019

#425 in Algorithms

Download history 24/week @ 2023-11-04 14/week @ 2023-11-11 13/week @ 2023-11-18 45/week @ 2023-11-25 37/week @ 2023-12-02 10/week @ 2023-12-09 26/week @ 2023-12-16 40/week @ 2023-12-23 20/week @ 2023-12-30 8/week @ 2024-01-06 8/week @ 2024-01-13 21/week @ 2024-01-20 36/week @ 2024-01-27 8/week @ 2024-02-03 75/week @ 2024-02-10 284/week @ 2024-02-17

405 downloads per month
Used in rlifesrc

MIT license

180KB
3.5K SLoC

rlifesrc-lib

GitHub Workflow Status Crates.io Docs.rs 中文

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.

For the documentation of released version of this crate, please visit docs.rs. There is also a documentation for the unreleased version on GitHub, which includes private functions and methods.

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!

Dependencies

~1.9–3.5MB
~70K SLoC