Add empty_position()
This commit is contained in:
		
							parent
							
								
									569a6eaf94
								
							
						
					
					
						commit
						67c292b9e2
					
				@ -24,6 +24,10 @@ impl World {
 | 
				
			|||||||
            Orientation::W => '←',
 | 
					            Orientation::W => '←',
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    /// Check if a position is free.
 | 
				
			||||||
 | 
					    fn empty_position(&mut self, p: Position) -> bool {
 | 
				
			||||||
 | 
					        self.map[(p.x * p.y) as usize] == '.'
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/// Struct to store robot position.
 | 
					/// Struct to store robot position.
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user