diff options
author | Hunky Jimpjorps <thechairman@thechairman.info> | 2023-12-12 06:14:55 -0500 |
---|---|---|
committer | Hunky Jimpjorps <thechairman@thechairman.info> | 2023-12-12 06:14:55 -0500 |
commit | 6a634c91145fab5b8ddb3af79c393607cd6272b6 (patch) | |
tree | 8f197820b1dfd91ef3e5b9d90c101d95ba5203b8 /aoc2023/src/day8 | |
parent | 3587c46e155ff45aecfb728c29f14e9c8a108095 (diff) | |
download | gleam_aoc-6a634c91145fab5b8ddb3af79c393607cd6272b6.tar.gz gleam_aoc-6a634c91145fab5b8ddb3af79c393607cd6272b6.zip |
day 12 complete, memoization utility added
Diffstat (limited to 'aoc2023/src/day8')
-rw-r--r-- | aoc2023/src/day8/solve.gleam | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/aoc2023/src/day8/solve.gleam b/aoc2023/src/day8/solve.gleam index cbd2f6a..6b36e2d 100644 --- a/aoc2023/src/day8/solve.gleam +++ b/aoc2023/src/day8/solve.gleam @@ -17,7 +17,7 @@ type Maze = Dict(String, Paths) fn parse(input: String) -> #(Iterator(String), Dict(String, Paths)) { - let [directions_str, maze_str] = string.split(input, "\n\n") + let assert [directions_str, maze_str] = string.split(input, "\n\n") let directions = directions_str @@ -52,6 +52,7 @@ fn to_next_step( case next_direction { "L" -> paths.to_left "R" -> paths.to_right + _ -> panic as "bad direction" } |> to_next_step(stop_at, count + 1, rest_directions, maze) } |