Advent of Code 2022 Day 12
- Plan: solve visually
Where's Waldowith each letter
- Shortest path to
- Drawing the spiral to
- Walking the spiral
Plan: solve visually
- I'm not skilled in writing traditional shortest-path algorithms, especially ones that use Dijkstra's algorithm - like A*
- I have been successful in recursively traversing a 2D grid as a half-baked alternative approach
- Perhaps that technique would work here
- But I first want to see if I could arrive at the correct answer using my eyes and careful analysis of my puzzle input
Where's Waldo with each letter
Find in my browser on the input, I highlighted each letter:
How about going from end to start?
Hmm...I'm starting to notice some interesting things in the placement of letters:
- There will be no way to avoid moving in a spiral from
- There are two sets of
k- one seems to create a wall around
d, and the other is the one I'll need to use
- All letters from
z- with the exceptions of
ijk- appear in a single cluster
- There are so many
- There is one column of
- There are tons of
as, but I'll likely need to avoid all but the one I start on
Shortest path to
- It seems there are two paths: one from above and one from below
- Drawing curvy lines makes the one from below feel shorter, especially since
es start at the bottom of the
Drawing the spiral to
I see now that I must traverse both sets of
Thus, the path will be these letters in order:
a b c d e f g h i j k i j k l m n o p q r s t u v w x y z
I'm fairly confident in the shape of my path and the letters that get me through it.
Now comes the hard part:
- Which specific instances of each letter in each set will get me from
zin the fewest steps
Walking the spiral
- I took it nice and slow
- I counted everything twice
Thankfully, that was the correct answer!
Not too many options, thankfully
- Sure, there are a ton of
- But because I need to move to a
b, I can only pick from the
as along the left edge
- And choosing any
as higher than the starting one in Part 1 would be foolish
- So my options are just the
as south of the starting one in Part 1
- Of those, it would be foolish to start from one that is any further south than a straight horizontal line from one of the
cs before the path trends downward
Visually, the yellow-highlighted segment starts from the
a that I believe heeds the shortest path:
I was right!
I did it!!
- I solved both parts!
- Using my eyes instead of a program!
- Which made this puzzle a lot more fun, actually!
I'm glad the grid of the puzzle was small enough to make it approachable for me.
And I enjoyed leveraging my browser's
Find tool to inspect each letter.
Top comments (0)