exemple token
This commit is contained in:
parent
bbcbfd4d41
commit
0a63ab5b53
@ -24,10 +24,14 @@ mod world;
|
||||
fn parse_config(raw_conf: String, pool: &Vec<robot::Robot>) -> Result<world::World, &'static str> {
|
||||
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<dyn std::error::Error>> {
|
||||
let raw_conf = open_file(matches.value_of("file").unwrap_or("two_robots.txt"))?;
|
||||
|
||||
let robot_pool: Vec<robot::Robot> = Vec::new();
|
||||
let world = parse_config(raw_conf, &robot_pool)?;
|
||||
let world: world::World = parse_config(raw_conf, &robot_pool)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user