From 39b1e81e556a7e777055361ee92d7e92acbff60f Mon Sep 17 00:00:00 2001 From: Martin HART Date: Thu, 5 Nov 2020 19:58:49 +0100 Subject: [PATCH] No robots was displayed on the grid, it's now fix --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 20c0a72..8780e64 100644 --- a/src/main.rs +++ b/src/main.rs @@ -253,8 +253,9 @@ fn main() -> Result<(), Box> { let raw_conf = open_file(matches.value_of("file").unwrap_or("two_robots.txt"))?; let mut robot_pool: Vec = Vec::new(); - let world: world::World = match matches.is_present("random-world") { - false => parse_config(raw_conf, &mut robot_pool)?, + let mut world: world::World = parse_config(raw_conf, &mut robot_pool)?; + world = match matches.is_present("random-world") { + false => world, true => world::random_world(), };