From d68c022cd7ff5df5c73e6d77e67d437105756023 Mon Sep 17 00:00:00 2001 From: Volodymyr Patuta <6977238-fiplox@users.noreply.gitlab.com> Date: Sat, 7 Nov 2020 13:40:17 +0100 Subject: [PATCH] fixed size of displayed grid --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 6b14ac8..492e1ca 100644 --- a/src/main.rs +++ b/src/main.rs @@ -199,13 +199,13 @@ fn display_grid( robot_pool: &Vec, h: &HashMap, ) { - for i in (0..w.y).rev() { + for i in (0..w.y + 1).rev() { if i < 10 { print!("{} ", i); } else { print!("{} ", i); } - for j in 0..w.x { + for j in 0..w.x + 1 { match h.get(&robot::Position { x: j, y: i }) { Some(id) => match robot_pool[(id - 1) as usize].o { robot::Orientation::N => print!("↑ "), @@ -220,7 +220,7 @@ fn display_grid( println!(); } print!(" "); - for j in 0..w.x { + for j in 0..w.x + 1 { if j < 10 { print!("{} ", j); } else {