Compare commits
No commits in common. "442b930c417e60c7c32665ee2db7861072c35726" and "26b649080e4d28b09b3e97056139ed489fe3e25e" have entirely different histories.
442b930c41
...
26b649080e
8
aoc.bqn
8
aoc.bqn
|
@ -2,12 +2,12 @@
|
|||
Sub ⇐ {a‿b𝕊𝕩:b↑a↓𝕩}
|
||||
|
||||
# e Split xs: split xs on occurrences of e (default 0)
|
||||
Split ⇐ {(⊏ ∾ 1⊸↓¨∘(1⊸↓)) Sub⟜𝕩¨ (» ⋈¨ ⊢-») /w⊸≡¨𝕩∾w←𝕨⊣0}
|
||||
Split ⇐ {(⊏ ∾ 1⊸↓¨∘(1⊸↓)) Sub⟜𝕩¨ (» ⋈¨ ⊢-») /w=𝕩∾(w←𝕨⊣0)}
|
||||
|
||||
# n Chunk xs: split into chunks of length n (the last one might be smaller)
|
||||
Chunk ⇐ {(⌊𝕨÷˜↕≠𝕩)⊔𝕩}
|
||||
|
||||
Day1 ⇐ {(⊑ ⋈ (+´3⊸↑)) ∨+´¨ •BQN⚇1 "" Split •FLines 𝕩}
|
||||
Day1 ⇐ (⊑ ⋈ (+´3⊸↑))∘(∨+´¨)∘Split∘(•BQN⎊0¨)∘•FLines
|
||||
# ⟨ 72602 207410 ⟩
|
||||
|
||||
Day2 ⇐ {
|
||||
|
@ -68,8 +68,8 @@ Day10 ⇐ {
|
|||
# (but the string is a big banner)
|
||||
|
||||
Day18 ⇐ { # part 1 only :[
|
||||
grid ← (↕∘> 1+⌈´)⊸∊ •BQN¨ '‿'⍟(=⟜',')⚇0 •FLines 𝕩
|
||||
touch ← +´⥊ «‿» {(𝕎⎉𝕩)⊸∧grid}⌜ 1+↕3
|
||||
grid ← (↕∘> 1+⌈˝)⊸∊ •BQN¨ '‿'⍟(=⟜',')⚇0 •FLines 𝕩
|
||||
touch ← +´⥊ «‿» {∧⟜(𝕎⎉𝕩) grid}⌜ 1+↕3
|
||||
+´⥊ (6×grid)-touch
|
||||
}
|
||||
# 3470
|
||||
|
|
2256
day21/part1.hs
2256
day21/part1.hs
File diff suppressed because it is too large
Load Diff
2376
day21/part2.maude
2376
day21/part2.maude
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue