Obviously very spoilery code, if you dare read it closely. try it here
It feels very anticlimactic to be ending so early in the month, but see you all next year!
# AOC 2025 day 12 - Packing parcels D ← "0:\n###\n##.\n##.\n\n1:\n###\n##.\n.##\n\n2:\n.##\n###\n##.\n\n3:\n##.\n###\n##.\n\n4:\n###\n#..\n###\n\n5:\n###\n.#.\n###\n\n4x4: 0 0 0 0 2 0\n12x5: 1 0 1 0 2 2\n12x5: 1 0 1 0 3 2" D ← &fras"AOC2025day12.txt" ▽⊸≡◇(˜∊@x)⊜□⊸≠@\nD /+≡◇(≤⊓/×(×9/+)°□₂≡⍚(⊜⋕⊸∊+@0⇡10)⊜□⊸≠@:)There’s so many great features hidden behind ‘un’.
I’m sure that part2 could be simplified significantly but I was fed up by then.
Uiua
If it’s stupid but it works…
# AOC2025day11 - mazes. # Uncomment for Part 1 D ← "aaa: you hhh\nyou: bbb ccc\nbbb: ddd eee\nccc: ddd eee fff\nddd: ggg\neee: out\nfff: out\nggg: out\nhhh: ccc fff iii\niii: out" # Uncomment for Part 2 # D ← "svr: aaa bbb\naaa: fft\nfft: ccc\nbbb: tty\ntty: ccc\nccc: ddd eee\nddd: hub\nhub: fff\neee: dac\ndac: fff\nfff: ggg hhh\nggg: out\nhhh: out" # D ← &fras "randomAOC/AOC2025day11.txt" Tabs ← ⊜(⊙□°⊂⊜∘¬⊸∊": ")⊸≠@\nD Nexts ← ⍣(°□⊡˜⨂⊙Tabs|[]) Count‼ ← ⊙◌⧻path(˙≠°⊏Nexts|≍^1)^0 Part₁ ← ⊙◌⧻path(˙≠°⊏Nexts|≍"out")"you" Part₂ ← ( ⊙◌⧻path(˙≠°⊏Nexts|≍"fft")"svr" ⊙◌⧻path(˙≠°⊏Nexts|≍"dac")"fft" ⊙◌⧻path(˙≠°⊏Nexts|≍"out")"dac" ×× ) # Only one will be right for the test data, depending on dataset. ⊃Part₁ Part₂Quiet here, isn’t it?
Here’s part1 to be going on with.
spoilerPath-finding takes waaaay too long for part 2. Off to do some linear algebra now :-(
# AOC 2025 Day 09 - Wiring maze D ← "[.##.] (3) (1,3) (2) (2,3) (0,2) (0,1) {3,5,4,7}\n[...#.] (0,2,3,4) (2,3) (0,4) (0,1,2) (1,2,3,4) {7,5,12,7,2}\n[.###.#] (0,1,2,3,4) (0,3,4) (0,1,2,4,5) (1,2) {10,11,11,5,10,5}" # D ← &fras"randomAOC/AOC2025day10.txt" Digits ← ⊜⋕⊸∊+@0⇡10 Parse ← ⊜(□⊜□⊸≠@\s)⊸≠@\n Part₁ ← ( ≡◇( =@#↘₁↘₋₁°□°⊂↘¯1 # target ⊙⬚0≡◇(°⊚Digits) # presses ⧻⊢path(≡⌞≠|=0/+) # find shortest path ) /+-1 ) Part₁ Parse DSqueezing all spaces out of the grid (and plotting at right-angles to the other visualisation here) gives this evil shape, which will doubtless haunt my dreams tonight.
Part 1 was easy, part 2 is …less so…
a hint that might help youvisualising the data reveals some interesting patterns
Any way, here’s my part 1 while I’m still thinking about this.
D ← "7,1\n11,1\n11,7\n9,7\n9,5\n2,5\n2,3\n7,3" # D ← &fras"AOC2025day09.txt" # <- uncomment to run live data /↥/×+1⌵⍉/-⍉₂⧅<2 ⋕°csv D # Part 1