The built-in path() function is one of those uiua features that were put in pretty much just to solve AoC problems, and makes this fairly simple.

Animation

Uiua's capabilities to render arrays into images, animations, and even sounds is very cool. An annual tradition for me is to spend a bunch of extra time making a random visualization of some problem instead of working on unsolved problems.

To that end I made an animation of the shortest path through the maze as each block is loaded in:

Source code in this pad. The &fwa function was used to make the full-sized gif.

AOC ~ "../aoc.ua"
Inp₁ ← AOC~Input 2024 18
&fwa "day18.gif" gif 50 Animate P Inp₁ 70_70

Then the gif was upscaled for publishing with ffmpeg:

ffmpeg -i day18.gif -vf "scale=720:-1" day18.webm