Merge branch 'remove-not-necessary' into 'master'
Remove not necessary See merge request mhart/DancingDroids!30
This commit is contained in:
		
						commit
						667da3ee66
					
				
							
								
								
									
										20
									
								
								src/main.rs
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								src/main.rs
									
									
									
									
									
								
							@ -109,26 +109,6 @@ impl Robot {
 | 
				
			|||||||
            Orientation::W => self.p.x -= 1,
 | 
					            Orientation::W => self.p.x -= 1,
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    /// Apply right instruction to the robot.
 | 
					 | 
				
			||||||
    fn move_right(&mut self, w: &mut World) {
 | 
					 | 
				
			||||||
        w.map[(self.p.x + (self.p.y * w.x as i32)) as usize] = '.';
 | 
					 | 
				
			||||||
        match self.o {
 | 
					 | 
				
			||||||
            Orientation::N => self.p.x += 1,
 | 
					 | 
				
			||||||
            Orientation::S => self.p.x -= 1,
 | 
					 | 
				
			||||||
            Orientation::E => self.p.y += 1,
 | 
					 | 
				
			||||||
            Orientation::W => self.p.y -= 1,
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    /// Apply left instruction to the robot.
 | 
					 | 
				
			||||||
    fn move_left(&mut self, w: &mut World) {
 | 
					 | 
				
			||||||
        w.map[(self.p.x + (self.p.y * w.x as i32)) as usize] = '.';
 | 
					 | 
				
			||||||
        match self.o {
 | 
					 | 
				
			||||||
            Orientation::N => self.p.x -= 1,
 | 
					 | 
				
			||||||
            Orientation::S => self.p.x += 1,
 | 
					 | 
				
			||||||
            Orientation::E => self.p.y -= 1,
 | 
					 | 
				
			||||||
            Orientation::W => self.p.y += 1,
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    /// Apply North orientation to the robot.
 | 
					    /// Apply North orientation to the robot.
 | 
				
			||||||
    fn set_north(&mut self) {
 | 
					    fn set_north(&mut self) {
 | 
				
			||||||
        self.o = Orientation::N
 | 
					        self.o = Orientation::N
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user