advent_of_code_2024

Module day_18

source
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 Positions to try until the goal is found.

Part 2 is implemented by MemorySpace::route_blocked_at which mostly re-uses part 1.

StructsΒ§

TraitsΒ§

FunctionsΒ§

Type AliasesΒ§