this post was submitted on 08 Dec 2025
1 points (100.0% liked)

Advent Of Code

1248 readers
1 users here now

An unofficial home for the advent of code community on programming.dev! Other challenges are also welcome!

Advent of Code is an annual Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.

Everybody Codes is another collection of programming puzzles with seasonal events.

EC 2025

AoC 2025

Solution Threads

M T W T F S S
1 2 3 4 5 6 7
8 9 10 11 12

Visualisations Megathread

Rules/Guidelines

Relevant Communities

Relevant Links

Credits

Icon base by Lorc under CC BY 3.0 with modifications to add a gradient

console.log('Hello World')

founded 3 years ago
MODERATORS
 

Day 8: Playground

Megathread guidelines

  • Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
  • You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL

FAQ

you are viewing a single comment's thread
view the rest of the comments
[–] mykl@lemmy.world 0 points 9 months ago* (last edited 9 months ago) (1 children)

Just a messy part1 so far. Plus a moment of pure rage when I realised the trap. (I have no idea what algorithm Lemmy uses to highlight Uiua code, but it's always a surprise.)

"162,817,812\n57,618,57\n906,360,560\n592,479,940\n352,342,300\n466,668,158\n542,29,236\n431,825,988\n739,650,466\n52,470,668\n216,146,977\n819,987,18\n117,168,530\n805,96,715\n346,949,466\n970,615,88\n941,993,340\n862,61,35\n984,92,344\n425,690,689"
# &fras"AOC2025day08.txt"β—Œ
Row ← (
  βŠ™(βŠƒβŠ’β†˜β‚)
  βŠšβ—‘β‰‘βŒŸβ—‡(/+˜∊)
  ⨬(βŠ‚βŠ™β–‘β—Œ                     # Not found: new circuit
  | ⍜⊑(βœΒ°β–‘(β—΄βŠ‚))⊒             # One found: add
  | β–½>β‚€βŠΈβ‰‘β—‡β§»βœ(⊏|βŠ‚{[]}{∘}β—΄/β—‡βŠ‚) # Connect two
  )βŠΈβ§»β—΄
)
β†β†―βˆž_3β—‡β‹•βŠœβ–‘βŠΈβˆŠ+@0⇑10
⊏⍏/+ⁿ2/-βŠΈβ‰βŠΈβ§…>2
β‰‘βŒŸβ‚Λœβ¨‚
{[°⊟]}Β°βŠ‚
Part₁ ← /×↙3β‡Œβ†β‰‘β—‡β§»β₯Row9 # MANUAL CHANGE TO 999 for live
βŠ™β—ŒPart₁
[–] strlcpy@lemmy.sdf.org 0 points 9 months ago

the trap

Re. what connections to process or not? That seems to be like one of those that's either completely obvious when you implement your solution one way, and a nasty pitfall when you do it another. In this case, pre-computing the list of pairs to process vs. finding the next one when you need it.