pub fn step(&self, direction: Direction) -> Location {
        let y = match direction {
            Up => self.y.wrapping_sub(1),
            Down => self.y.wrapping_add(1),
            _ => self.y,
        };

        let x = match direction {
            Right => self.x.wrapping_add(1),
            Left => self.x.wrapping_sub(1),
            _ => self.x,
        };

        Location { x: x, y: y }
    }
//step takes the location and moves in given a direction
step takes the location and moves in given a direction
step takes the location and moves in given a direction
pub fn step(&self, direction: Direction) -> Location {
        let y = match direction {
            Up => self.y.wrapping_sub(1),
            Down => self.y.wrapping_add(1),
            _ => self.y,
        };
        let x = match direction {
            Right => self.x.wrapping_add(1),
            Left => self.x.wrapping_sub(1),
            _ => self.x,
        };
        Location { x: x, y: y }
    }
pub fn step ( & self , direction : Direction ) -> Location { let y = match direction { Up => self . y . wrapping_sub ( 1 ) , Down => self . y . wrapping_add ( 1 ) , _ => self . y , } ; let x = match direction { Right => self . x . wrapping_add ( 1 ) , Left => self . x . wrapping_sub ( 1 ) , _ => self . x , } ; Location { x : x , y : y } }
step takes the location and moves in given a direction
step takes the location and moves in given a direction
&self
direction
Direction
&self
direction
Direction