Expand description
This is my solution for Advent of Code - Day 18: RAM Run
parse_input
uses parse_coordinate
to turn the puzzle input into a MemorySpace
Part 1 is solved by MemorySpace::steps_to_goal
, using Position
to store intermediate stages in a struct
that implements Ord
. CoordinateExtensions::manhattan_distance
, CoordinateExtensions::step
and
Position::next
provide the ways to build up the list of next Position
s to try until the goal is found.
Part 2 is implemented by MemorySpace::route_blocked_at
which mostly re-uses part 1.
StructsΒ§
- Memory
Space π - Position π
TraitsΒ§
- Coordinate
Extensions π
FunctionsΒ§
- parse_
coordinate π - parse_
input π - The entry point for running the solutions with the βrealβ puzzle input.
Type AliasesΒ§
- Coordinates πA Coordinate in Memory Space