Merge branch 'fix-display' into 'master'
fix display grid > 10 See merge request mhart/DancingDroids!51
This commit is contained in:
		
						commit
						623c4e276b
					
				@ -205,7 +205,11 @@ fn display_grid(
 | 
				
			|||||||
    h: &HashMap<robot::Position, u32>,
 | 
					    h: &HashMap<robot::Position, u32>,
 | 
				
			||||||
) {
 | 
					) {
 | 
				
			||||||
    for i in (0..w.y).rev() {
 | 
					    for i in (0..w.y).rev() {
 | 
				
			||||||
 | 
					        if i < 10 {
 | 
				
			||||||
            print!("{}  ", i);
 | 
					            print!("{}  ", i);
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            print!("{} ", i);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        for j in 0..w.x {
 | 
					        for j in 0..w.x {
 | 
				
			||||||
            match h.get(&robot::Position { x: j, y: i }) {
 | 
					            match h.get(&robot::Position { x: j, y: i }) {
 | 
				
			||||||
                Some(id) => match robot_pool[(id - 1) as usize].o {
 | 
					                Some(id) => match robot_pool[(id - 1) as usize].o {
 | 
				
			||||||
@ -222,7 +226,11 @@ fn display_grid(
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
    print!("   ");
 | 
					    print!("   ");
 | 
				
			||||||
    for j in 0..w.x {
 | 
					    for j in 0..w.x {
 | 
				
			||||||
 | 
					        if j < 10 {
 | 
				
			||||||
            print!("{}  ", j);
 | 
					            print!("{}  ", j);
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            print!("{} ", j);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    println!();
 | 
					    println!();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user