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