diff --git a/src/main.rs b/src/main.rs index 3652955..dd5a77a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -24,6 +24,10 @@ impl World { Orientation::W => '←', } } + /// Check if a position is free. + fn empty_position(&mut self, p: Position) -> bool { + self.map[(p.x * p.y) as usize] == '.' + } } /// Struct to store robot position.