poking and prodding
This commit is contained in:
parent
100c504855
commit
72d3d8da40
1 changed files with 5 additions and 5 deletions
10
aoc.bqn
10
aoc.bqn
|
@ -12,12 +12,12 @@ Day1 ⇐ (⊑ ⋈ (+´3⊸↑))∘(∨+´¨)∘Split∘(•BQN⎊0¨)∘•FLine
|
|||
|
||||
Day2 ⇐ {
|
||||
B ← ⊣ (A ← {1+𝕩+3×3|1+𝕩-𝕨}) {3|𝕨+𝕩-1}
|
||||
+´˘⍉ (A≍B)´∘{a‿s‿b:⟨a-'A',b-'X'⟩}˘ >•FLines 𝕩
|
||||
+´ (A⋈B)´∘{"AX"-˜0‿2⊏𝕩}¨ •FLines 𝕩
|
||||
}
|
||||
# ⟨ 17189 13490 ⟩
|
||||
|
||||
Day3 ⇐ {
|
||||
Prio ← ⊢ - ⊑⟜"`&"∘(≤⟜'Z')
|
||||
Prio ← ⊢ - ≤⟜'Z'◶"`&"
|
||||
A ← +´∘∾ {(Prio¨×∊⟜𝕩)𝕨}○⍷´∘(<˘ 2‿∘⊸⥊)¨
|
||||
B ← +´∘∾ {a‿b‿c:(Prio¨a)×b∧○(a⊸∊)c}¨∘(3⊸Chunk)∘(⍷¨)
|
||||
(A⋈B) •FLines 𝕩
|
||||
|
@ -25,10 +25,10 @@ Day3 ⇐ {
|
|||
# ⟨ 7683 2488 ⟩
|
||||
|
||||
Day4 ⇐ {
|
||||
Line ← •BQN∘> '‿'⍟(∊⟜"-,")¨ # hehe
|
||||
F ← {∨´∧´˘≥´⎉1(2¨↕3)⥊𝕩⊏˜𝕨-'a'}
|
||||
Line ← •BQN '‿'⍟(⊑∊⟜"-,")¨ # hehe
|
||||
F ← {∨´∧´˘≥´⎉1(3⥊2)⥊𝕩⊏˜𝕨-'a'}
|
||||
A ← "cabddbac"⊸F, B ← "cabcacda"⊸F
|
||||
+´(A⋈B)∘Line¨•FLines 𝕩
|
||||
+´ (A⋈B)∘Line¨ •FLines 𝕩
|
||||
}
|
||||
# ⟨ 536 845 ⟩
|
||||
# •Show Day4 ⊑•args
|
||||
|
|
Loading…
Reference in a new issue