advent_of_code_2024

Module day_15

source
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Β§

EnumsΒ§

  • Move πŸ”’
    Represents one of the move steps of the robot

TraitsΒ§

FunctionsΒ§

  • parse_input πŸ”’
    Turn the puzzle input into a SingleWarehouse, and list of Moves.
  • The entry point for running the solutions with the β€˜real’ puzzle input.

Type AliasesΒ§

  • Coordinate πŸ”’
    Coordinates of a position in the warehouse