Skip to main content

deadlock_left

Function deadlock_left 

Source
fn deadlock_left(burrow: &Burrow) -> bool
Expand description

Checks for a situation where an A amphipod can block other amphipods in the leftmost burrow.

For example:

#############
#...A.......#
### #.#.#.###
  #A#.#.#.#
  #A#.#.#.#
  #B#.#.#.#
  #########

The top two As can move into the left hallway spaces but the B will then be stuck and we’ll never be able to organize the burrow completely.