Uiua
Decided to try and use Uiua for each day this year. At least I'm not the only one to get this idea ^^
Run with example input here
PartOne β (
&rs β &fo "input-1.txt"
β(βββ @ .)β @\n.
β‘ββ
β΅/-
/+
)
PartTwo β (
&rs β &fo "input-1.txt"
β(βββ @ .)β @\n.
β’ββ£β
0
β’(+β(:β(Γ⧻ββ‘β)β1ββ’)|β
(β 0⧻))
β(ββ) # just cleaning up the stack
)
&p "Day 1:"
&pf "Part 1: "
&p PartOne
&pf "Part 2: "
&p PartTwo
Uiua
Took me a bit longer to get this one but still quite simple overall.
Spent quite some time on getting to know the
try
andassert
operators better.Run with example input here