bqn5
This commit is contained in:
parent
1da0498792
commit
e8b5d3cfcf
1 changed files with 17 additions and 1 deletions
18
aoc.bqn
18
aoc.bqn
|
@ -31,4 +31,20 @@ Day4 ⇐ {
|
||||||
+´ (A⋈B)∘Line¨ •FLines 𝕩
|
+´ (A⋈B)∘Line¨ •FLines 𝕩
|
||||||
}
|
}
|
||||||
# ⟨ 536 845 ⟩
|
# ⟨ 536 845 ⟩
|
||||||
# •Show Day4 ⊑•args
|
|
||||||
|
Day5 ⇐ {
|
||||||
|
inp ← •FLines 𝕩
|
||||||
|
Start ← {(𝕨⊸=⊑⎊0)¨⊸/ 𝕩}
|
||||||
|
stks ← ' '⊸≠⊸/¨ <˘ ⍉> (1⊸⊑¨ 4⊸Chunk)¨ '[' Start inp
|
||||||
|
todo ← •BQN⚇1 (1‿3‿5⊸⊏ ' '⊸Split)¨ 'm' Start inp
|
||||||
|
_Do1 ← {
|
||||||
|
n‿s‿t ← 𝕩 - 0‿1‿1
|
||||||
|
l‿r ← n (↑⋈↓) s⊑𝕨
|
||||||
|
(𝔽 l)⊸∾⌾(t⊸⊑) r⌾(s⊸⊑) 𝕨
|
||||||
|
}
|
||||||
|
_Do ← {⊑¨ 𝕨𝔽_Do1˜´⌽𝕩}, A ← ⌽_Do, B ← ⊢_Do
|
||||||
|
stks (A⋈B) todo
|
||||||
|
}
|
||||||
|
# ⟨ "QNNTGTPFN" "GGNPJBTTR" ⟩
|
||||||
|
|
||||||
|
# •Show Day5 ⊑•args
|
||||||
|
|
Loading…
Reference in a new issue