What the hell ! FUCKING LIB !

This commit is contained in:
Martin HART 2020-11-04 21:43:02 +01:00
parent 912edc855a
commit 77d9452433
1 changed files with 5 additions and 1 deletions

View File

@ -250,7 +250,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let raw_conf = open_file(matches.value_of("file").unwrap_or("two_robots.txt"))?; let raw_conf = open_file(matches.value_of("file").unwrap_or("two_robots.txt"))?;
let mut robot_pool: Vec<robot::Robot> = Vec::new(); let mut robot_pool: Vec<robot::Robot> = Vec::new();
let world: world::World = parse_config(raw_conf, &mut robot_pool)?; let world: world::World = match matches.value_of("random-world") {
None => parse_config(raw_conf, &mut robot_pool)?,
Some(_) => world::random_world(),
};
let mut hash: HashMap<robot::Position, u32> = HashMap::new(); let mut hash: HashMap<robot::Position, u32> = HashMap::new();
create_hash_map(&robot_pool, &mut hash); create_hash_map(&robot_pool, &mut hash);
println!("World {{ x_max = {}; y_max = {} }}", world.x, world.y); println!("World {{ x_max = {}; y_max = {} }}", world.x, world.y);