2 pub struct DeterministicRng {
10 impl DeterministicRng {
11 pub fn new() -> Self {
12 DeterministicRng { count: 0, x: 0x193a6754, y: 0xa8a7d469, z: 0x97830e05, w: 0x113ba7bb }
15 /// Guarantees that each returned number is unique.
16 pub fn next(&mut self) -> u32 {
18 assert!(self.count <= 70029);
20 let t = x ^ (x << 11);
25 self.w = w_ ^ (w_ >> 19) ^ (t ^ (t >> 8));