From 6c19f303fa32c88691dff412ff755dffa96e0c10 Mon Sep 17 00:00:00 2001 From: Martin HART Date: Tue, 20 Oct 2020 13:42:32 +0200 Subject: [PATCH] Add create_map() --- src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.rs b/src/main.rs index 95c945d..0300cd7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,6 +9,13 @@ struct World { map: Vec, } +impl World { + /// Create a new map full of dots. + fn create_map(&mut self) { + self.map = vec!['.'; (self.x * self.y) as usize]; + } +} + /// Struct to store robot position. struct Position { x: u32, @@ -112,6 +119,7 @@ fn open_file(filename: &str) -> io::Result { } fn main() -> Result<(), Box> { + // We handle CLI flags here. let matches = App::new("DancingDroids") .version("0.1.0") .about("When droids dance togethers")