Propagate walker change of behaviour to rust code

This commit is contained in:
Joshua Coles 2023-03-03 15:45:04 +00:00
parent da53077f9a
commit 0a56c6f83f

View File

@ -17,7 +17,7 @@ impl LocalRandomWalker {
impl<R: Rng> Walker<R> for LocalRandomWalker {
fn walk(&self, rng: &mut R, position: &Position) -> Position {
let (dim, sign) = rng.gen_range(0u32..(DIM * 2)).div_rem(&self.dim);
let sign = if sign == 0 { -1 } else { 1 };
let sign = if sign == 0 { 1 } else { -1 };
let offset = Position::in_direction(dim, sign);
position.clone() + offset