Pseudorandom number generator from the "Xorshift RNGs" paper by George Marsaglia. https://github.com/rust-lang/rust/blob/1.55.0/library/core/src/slice/sort.rs#L559-L573
(seed: u32)
| 98 | // |
| 99 | // https://github.com/rust-lang/rust/blob/1.55.0/library/core/src/slice/sort.rs#L559-L573 |
| 100 | fn random(seed: u32) -> impl Iterator<Item = u32> { |
| 101 | let mut random = seed; |
| 102 | std::iter::repeat_with(move || { |
| 103 | random ^= random << 13; |
| 104 | random ^= random >> 17; |
| 105 | random ^= random << 5; |
| 106 | random |
| 107 | }) |
| 108 | } |
| 109 | |
| 110 | /// Simulate the debugger state |
| 111 | struct State { |