day 9 not too bad
parent
0b04ce2c3c
commit
d7a938783f
@ -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"
|
Loading…
Reference in New Issue