diff --git a/src/main.rs b/src/main.rs index 851406c..81876d4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -24,10 +24,14 @@ mod world; fn parse_config(raw_conf: String, pool: &Vec) -> Result { let mut lines = raw_conf.lines(); // The first line of the config file should be the World. - let raw_map: &str = match lines.next() { + let raw_line: &str = match lines.next() { None => return Err("Could not read the first line of the config file !"), Some(raw) => raw, }; + let raw_token = raw_line.split_whitespace(); + let token1 = raw_token.next(); + let token2 = raw_token.next(); + // Need to check if the robots fit in the World. Ok(world::World { x: 5, y: 5 }) } @@ -54,7 +58,7 @@ fn main() -> Result<(), Box> { let raw_conf = open_file(matches.value_of("file").unwrap_or("two_robots.txt"))?; let robot_pool: Vec = Vec::new(); - let world = parse_config(raw_conf, &robot_pool)?; + let world: world::World = parse_config(raw_conf, &robot_pool)?; Ok(()) }