diff --git a/src/main.rs b/src/main.rs index 0300cd7..df4cbd6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,6 +14,15 @@ impl World { fn create_map(&mut self) { self.map = vec!['.'; (self.x * self.y) as usize]; } + /// Set robot on the map. + fn set_robot(&mut self, r: Robot) { + self.map[(r.p.x * r.p.y) as usize] = match r.o { + Orientation::N => '⬆', + Orientation::S => '⬇', + Orientation::E => '➡', + Orientation::W => '⬅', + } + } } /// Struct to store robot position.