This commit is contained in:
rhiannon morris 2022-12-02 08:41:12 +01:00
parent 90c2a52251
commit 601ade63d1

13
aoc.bqn
View file

@ -2,10 +2,13 @@
Sub {ab𝕊𝕩:ba𝕩}
# e Split xs: split xs on occurrences of e (default 0)
Split {Sub𝕩¨ ((1+») ¨ -») /(𝕨0)=𝕩}
Split {( 1¨(1)) Sub𝕩¨ (» ¨ -») /𝕨=𝕩(𝕨0)}
Day1 {
sums +´¨ Split •BQN0¨ •FLines 𝕩
sums, +´3sums
Day1 ( (+´3))(+´¨)Split(•BQN0¨)•FLines
Day2 {
Line -"AX" ' 'Split
B (A {1+𝕩+3×3|1+𝕩-𝕨}) {3|𝕨+𝕩-1}
+´˘ (AB)´Line˘ >•FLines 𝕩
}
•Show Day1 •args
# •Show Day2 ⊑•args