Expand description
This is my solution for Advent of Code - Day 15: Warehouse Woes
parse_input uses SingleWarehouse::from_str and Move::try_from to parse the two sections of the input.
Warehouse holds common logic for both partsβ warehouse implementations. Warehouse::sum_gps provides the
puzzle solution for both parts, deferring to Warehouse::apply_moves, and the part specific
implementations of Warehouse::move_robot and Warehouse::move_box.
SingleWarehouse provides the implementation for part 1.
DoubleWarehouse provides the implementation for part 2, with SingleWarehouse::double to convert the
representation.
StructsΒ§
- Double
Warehouse π - Single
Warehouse πWarehouse implementation of part 1
EnumsΒ§
- Move πRepresents one of the move steps of the robot
TraitsΒ§
- Warehouse π
FunctionsΒ§
- parse_
input πTurn the puzzle input into aSingleWarehouse, and list ofMoves. - The entry point for running the solutions with the βrealβ puzzle input.
Type AliasesΒ§
- Coordinate πCoordinates of a position in the warehouse