lsystems 0.2.1

A simple library for working with Lindenmayer systems.
Documentation
  • Coverage
  • 88.89%
    8 out of 9 items documented1 out of 8 items with examples
  • Size
  • Source code size: 50.33 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.41 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 17s Average build duration of successful builds.
  • all releases: 17s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • mechaxl/lsystems
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • mechaxl

Introduction

This project aims to provide a simple interface for working with L-systems in the Rust programming language.

Examples

let mut system = LSystem::with_axiom("b");
system.add_rule('a', "ab");
system.add_rule('b', "a");

for step in 0..10 {
    println!("Step #{}: {}", step, system.next().unwrap());
}
let mut system = LSystem::with_axiom("baaaaaaa");
system.add_rule('b', "a");
system.add_context_rule((Some("b"), 'a', None), "b");

assert_eq!(system.next().unwrap(), "baaaaaaa");
assert_eq!(system.next().unwrap(), "abaaaaaa");
assert_eq!(system.next().unwrap(), "aabaaaaa");
assert_eq!(system.next().unwrap(), "aaabaaaa");
assert_eq!(system.next().unwrap(), "aaaabaaa");
assert_eq!(system.next().unwrap(), "aaaaabaa");
assert_eq!(system.next().unwrap(), "aaaaaaba");
assert_eq!(system.next().unwrap(), "aaaaaaab");
assert_eq!(system.next().unwrap(), "aaaaaaaa");