diff --git a/day09.ua b/day09.ua new file mode 100644 index 0000000..61b586f --- /dev/null +++ b/day09.ua @@ -0,0 +1,16 @@ +$ 0 3 6 9 12 15 +$ 1 3 6 10 15 21 +$ 10 13 16 21 30 45 +TestInput ← + +Parse ← ⊜(⊜⋕≠@ .)≠@\n. + +Differences ← ⍢(⊂:□≡/-◫2°□⊢⇌.)(¬≍⊚⧻.°□⊢⇌)¤□ +NextElement ← /+≡(⊢⇌)Differences +PrevElement ← /-⇌≡⊢Differences + +/+≡NextElement Parse TestInput +/+≡PrevElement Parse TestInput + +/+≡NextElement Parse &fras "day09.in" +/+≡PrevElement Parse &fras "day09.in"