6 releases
0.2.0 | Dec 13, 2023 |
---|---|
0.1.4 | Dec 12, 2023 |
0.1.1 | Oct 23, 2023 |
#2621 in Algorithms
47 downloads per month
13KB
236 lines
Rule30
Pseudo random number generator with cellular automaton rule 30.
Features
-
no_std
- Extend CA for better performance
Usage
use rule30::prelude::*;
fn main() {
let mut ca = ExtendedCA::seed_from_u64(42);
println!("{}", ca.next_u64());
}
To work with rand
crate:
use rule30::prelude::*;
use rand::Rng;
fn main() {
let mut ca = ExtendedCA::seed_from_u64(42);
println!("{}", ca.gen::<f64>());
}
For Python binding, check rule30py
Reference
- Wolfram Rule30
- Wolfram ExtendedCA
Dependencies
~44KB