Module doe::rand::rand

source ·
Expand description
use doe::*;
let lcg = LCG::new();
for _ in 0..10000{
   let data = lcg.random_in_range(1..=20).to_string().push_back("\n");
   fs::fs::append_data_to_file("doe.txt", data).unwrap();
}

Structs§

  • A Linear Congruential Generator (LCG) is a simple type of random number generator that produces a sequence of pseudo-random numbers based on a linear recurrence relation.