Merge branch 'fix-display' into 'master'
fixed size of displayed grid See merge request mhart/DancingDroids!54
This commit is contained in:
commit
48c78dab70
@ -199,13 +199,13 @@ fn display_grid(
|
||||
robot_pool: &Vec<robot::Robot>,
|
||||
h: &HashMap<robot::Position, u32>,
|
||||
) {
|
||||
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user