diff --git a/src/lib.rs b/src/lib.rs index 32f5807..46c4475 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -250,10 +250,10 @@ impl State { fn move_dir(&mut self, dir: Direction) -> Result<(bool, bool)> { match dir { - Direction::U => self.move_pos(Pos(0, -1)), - Direction::D => self.move_pos(Pos(0, 1)), - Direction::L => self.move_pos(Pos(-1, 0)), - Direction::R => self.move_pos(Pos(1, 0)), + Direction::U => self.move_pos(Self::DIR_POS[0]), + Direction::D => self.move_pos(Self::DIR_POS[1]), + Direction::L => self.move_pos(Self::DIR_POS[2]), + Direction::R => self.move_pos(Self::DIR_POS[3]), } }