From 426cd1ecd732e946bdbfb985604056335d72c9d5 Mon Sep 17 00:00:00 2001 From: Volodymyr Patuta <6977238-fiplox@users.noreply.gitlab.com> Date: Thu, 5 Nov 2020 13:53:02 +0100 Subject: [PATCH] fix display grib > 10 --- src/main.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2a9057c..cdfa277 100644 --- a/src/main.rs +++ b/src/main.rs @@ -205,7 +205,11 @@ fn display_grid( h: &HashMap, ) { for i in (0..w.y).rev() { - print!("{} ", i); + if i < 10 { + print!("{} ", i); + } else { + print!("{} ", i); + } for j in 0..w.x { match h.get(&robot::Position { x: j, y: i }) { Some(id) => match robot_pool[(id - 1) as usize].o { @@ -222,7 +226,11 @@ fn display_grid( } print!(" "); for j in 0..w.x { - print!("{} ", j); + if j < 10 { + print!("{} ", j); + } else { + print!("{} ", j); + } } println!(); }