diff options
Diffstat (limited to 'src/frontier/min.rs')
-rw-r--r-- | src/frontier/min.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/frontier/min.rs b/src/frontier/min.rs index 2a332e6..77c475f 100644 --- a/src/frontier/min.rs +++ b/src/frontier/min.rs @@ -76,9 +76,9 @@ where fn free_neighbor(&mut self, x: u32, y: u32) -> Option<(u32, u32)> { // Pick a pseudo-random neighbor - let offset: usize = self.rng.gen(); - let neighbors = neighbors(x, y); + let offset = self.rng.random_range(..neighbors.len()); + for i in 0..8 { let (x, y) = neighbors[(i + offset) % 8]; if x < self.width && y < self.height { |