Merge branch 'world' into 'master'
Create a new world O_o See merge request mhart/DancingDroids!19
This commit is contained in:
		
						commit
						3d686c7770
					
				| @ -9,6 +9,13 @@ struct World { | |||||||
|     map: Vec<char>, |     map: Vec<char>, | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | impl World { | ||||||
|  |     /// Create a new map full of dots.
 | ||||||
|  |     fn create_map(&mut self) { | ||||||
|  |         self.map = vec!['.'; (self.x * self.y) as usize]; | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | 
 | ||||||
| /// Struct to store robot position.
 | /// Struct to store robot position.
 | ||||||
| struct Position { | struct Position { | ||||||
|     x: u32, |     x: u32, | ||||||
| @ -112,6 +119,7 @@ fn open_file(filename: &str) -> io::Result<String> { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| fn main() -> Result<(), Box<dyn std::error::Error>> { | fn main() -> Result<(), Box<dyn std::error::Error>> { | ||||||
|  |     // We handle CLI flags here.
 | ||||||
|     let matches = App::new("DancingDroids") |     let matches = App::new("DancingDroids") | ||||||
|         .version("0.1.0") |         .version("0.1.0") | ||||||
|         .about("When droids dance togethers") |         .about("When droids dance togethers") | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Martin HART
						Martin HART