Day 10: Factory

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
[–] 5 points 9 months ago* (last edited 9 months ago) (4 children)

Uiua

(added language tag)

Quiet here, isn't it?

Here's part1 to be going on with.

# AOC 2025 Day 10 - 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 D

I've given up on Part 2. I knew what I needed to do but didn't have the understanding of how to use the matrix elimination method to get beyond the first stages. But I did find this:

How to solve part 2 without librariesThis is a solver written totally from scratch in Dart, so easily readable unlike some other languages :-): [https://github.com/ayoubzulfiqar/advent-of-code/blob/main/2025/Dart/Day10/part_2.dart](GitHub link)

There's lots of parallelism (that's over the top for this problem), but the core solveSystem method is very clearly written, just long...

  • source
  • hideshow 4 child comments