Tootfinder

Opt-in global Mastodon full text search. Join the index!

@thek3nger@mastodon.social
2025-12-06 13:18:56

In Part 2 I did a REAL MESS. But surprisingly, it works in 10 milliseconds. Time to make this more presentable, I guess.
(I don't particularly like parse-based challenges)
I just completed "Trash Compactor" - Day 6 - Advent of Code 2025 #AdventOfCode

  let numbers =
    lines
    |> list.map(string.to_graphemes)
    |> list.transpose
    |> list.chunk(last_is_operator)
    |> list.sized_chunk(2)
    |> list.map(list.flatten)
    |> list.map(fn(c) { list.map(c, fn(d) { list.take(d, lines_number) }) })
    |> list.map(fn(c) { list.map(c, string.concat) })
    |> list.map(fn(c) { list.map(c, fn(d) { string.trim(d) }) })
    |> list.map(fn(c) { list.map(c, fn(d) { int.parse(d) }) })
    &#…