From d87ab543700abe4d3a29a463642b2277f292ce92 Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Mon, 2 Dec 2024 09:04:40 -0800 Subject: [PATCH] [2024][uiua][2.x] --- 2024/uiua/day_02.ua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 2024/uiua/day_02.ua 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