Crates.io | rule30 |
lib.rs | rule30 |
version | 0.2.0 |
source | src |
created_at | 2023-10-20 10:50:55.020068 |
updated_at | 2023-12-13 02:15:19.340113 |
description | Pseudo random number generator with cellular automaton rule 30. |
homepage | |
repository | https://github.com/kemingy/rule30 |
max_upload_size | |
id | 1008874 |
size | 33,754 |
Pseudo random number generator with cellular automaton rule 30.
no_std
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