Comment on
💃 - 2025 DAY 6 SOLUTIONS - 💃
Uiua
I'm new to Uiua, so probably not the best way to express the solution!
ParseRows ← (
⊜∘⊸≠@\n
⍜⇌°⊂ # Get the row of operations.
)
ParseOperations ← ⊜⊢⊸≠@\s
SumCalculations ← (
≡(
⍣(◇/×°@*
| ◇/+°@+
)
)
/+
)
Part₁ ← (
ParseRows
⊓(ParseOperations
| ⍉ ≡(⊜⋕⊸≠@\s) # Parse columns.
)
SumCalculations
)
Part₂ ← (
ParseRows
⊓(ParseOperations
| ⊜(□≡(⋕▽⊸≠@\s)) ≡/↥⊸≠@\s⍉ # Parse numbers.
)
SumCalculations
)
&fras "6.txt"
⊃Part₁ Part₂