fn pop_room(&mut self, room: usize) -> usize {
        debug_assert!(0 < room && room < 5);
        let doorstep = 7 + (room - 1) * DEPTH - 1; // Not a real index, but becomes one +1.
        for steps in 1..=DEPTH {
            if self.0[doorstep + steps] != 0 {
                self.0[doorstep + steps] = 0;
                return steps;
            }
        }
        panic!("Tried to pop room {} from an empty room", room);
    }
// Removes the top amphipod from the room and returns the step count used.
Removes the top amphipod from the room and returns the step count used.
Removes the top amphipod from the room and returns the step count used .
fn pop_room(&mut self, room: usize) -> usize {
        debug_assert!(0 < room && room < 5);
        let doorstep = 7 + (room - 1) * DEPTH - 1; // Not a real index, but becomes one +1.
        for steps in 1..=DEPTH {
            if self.0[doorstep + steps] != 0 {
                self.0[doorstep + steps] = 0;
                return steps;
            }
        }
        panic!("Tried to pop room {} from an empty room", room);
    }
fn pop_room ( & mut self , room : usize ) -> usize { debug_assert ! ( 0 room room 5 ) ; let doorstep = 7 + ( room - 1 ) * DEPTH - 1 ; // Not a real index, but becomes one +1. for steps in 1 ..= DEPTH { if self . 0 [ doorstep + steps ] != 0 { self . 0 [ doorstep + steps ] = 0 ; return steps ; } } panic ! ( " " room ) ; }
Removes the top amphipod from the room and returns the step count used.
Removes the top amphipod from the room and returns the step count used .
&mut self
room
usize