2022-12-02 01:19:46 -05:00
|
|
|
|
# a‿b Sub x: the b-length subarray starting at a
|
|
|
|
|
Sub ⇐ {a‿b𝕊𝕩:b↑a↓𝕩}
|
|
|
|
|
|
|
|
|
|
# e Split xs: split xs on occurrences of e (default 0)
|
2022-12-02 02:41:12 -05:00
|
|
|
|
Split ⇐ {(⊏ ∾ 1⊸↓¨∘(1⊸↓)) Sub⟜𝕩¨ (» ⋈¨ ⊢-») /𝕨=𝕩∾(𝕨⊣⟜0↩)}
|
2022-12-02 01:19:46 -05:00
|
|
|
|
|
2022-12-02 02:41:12 -05:00
|
|
|
|
Day1 ⇐ (⊑ ⋈ (+´3⊸↑))∘(∨+´¨)∘Split∘(•BQN⎊0¨)∘•FLines
|
|
|
|
|
|
|
|
|
|
Day2 ⇐ {
|
|
|
|
|
B ← ⊣ (A ← {1+𝕩+3×3|1+𝕩-𝕨}) {3|𝕨+𝕩-1}
|
2022-12-03 00:33:45 -05:00
|
|
|
|
+´˘⍉ (A≍B)´∘{a‿s‿b:⟨a-'A',b-'X'⟩}˘ >•FLines 𝕩
|
2022-12-01 14:37:22 -05:00
|
|
|
|
}
|
2022-12-03 00:33:45 -05:00
|
|
|
|
•Show Day2 ⊑•args
|
|
|
|
|
|
|
|
|
|
# day 3 maybe later
|