diff --git a/2024/uiua/day_02.ua b/2024/uiua/day_02.ua new file mode 100644 index 0000000..1569187 --- /dev/null +++ b/2024/uiua/day_02.ua @@ -0,0 +1,21 @@ +# Experimental! + +$ 7 6 4 2 1 +$ 1 2 7 8 9 +$ 9 7 6 2 1 +$ 1 3 2 4 5 +$ 8 6 4 4 1 +$ 1 3 6 7 9 +Raw ← + +Records ← ⊜(⊜⋕≠@ .)≠@\n. Raw + +IsSafe ← ∨∩(¬∈:0 =2+⊃(>0)(<4) ≡(-°⊟)◫2) ⟜⇌ + +# part one +/+ ≡IsSafe Records + +Dampened ← ≡°¤ ⊞(⍜↻(↘1)) ⊙¤ ⊸(⇡⧻) + +# part two +/+ ≡(/∨∨⊃IsSafe(/∨≡IsSafe Dampened)) Records