Skip to content

Commit

Permalink
refact: minor clean up day 4.
Browse files Browse the repository at this point in the history
  • Loading branch information
Panadestein committed Dec 4, 2024
1 parent 311b69f commit f44b7f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/aoc24.org
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ These definitions and imports are shared by the various puzzles:
IV ← {
inp ← >•FLines Input 𝕩
t‿ts ← ⟨"XMAS"‿"SAMX", "MSAMS"‿"SMASM"‿"SSAMM"‿"MMASS"⟩
eins ⇐ +´t(≢∘⊢↑⍷){+´⟨⥊+´𝕨𝔽¨<𝕩, +´𝕨𝔽¨<⍉𝕩, ∾+˝𝕨𝔽⌜𝔾𝕩, ∾+˝𝕨𝔽⌜𝔾⌽⍉𝕩⟩}((+⌜´↕¨∘≢)⊸⊔) inp
zwei ⇐ +´⥊{ts≡¨<(⌽˘⊸∨=⌜˜↕3)/○⥊𝕩}⎉2 3‿3↕inp
eins ⇐ t ⍷{+´+´∘⥊¨⟨+´𝕨𝔽¨<𝕩, +´𝕨𝔽¨<⍉𝕩, ∾+˝𝕨𝔽⌜𝔾𝕩, ∾+˝𝕨𝔽⌜𝔾⌽⍉𝕩⟩}(⊢⊔˜·+⌜´↕¨∘≢) inp
xm ← ⌽˘⊸∨=⌜˜↕3 ⋄ zwei ⇐ +´⥊{ts≡¨<xm/○⥊𝕩}⎉2 3‿3↕inp
}
IV _is 4
#+end_src
Expand Down
4 changes: 2 additions & 2 deletions src/bqn/aoc24.bqn
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ III _is 3
IV ← {
inp>•FLines Input 𝕩
tts ← ⟨"XMAS""SAMX", "MSAMS""SMASM""SSAMM""MMASS"
eins+´t(⊢↑⍷){+´+´𝕨𝔽¨<𝕩, +´𝕨𝔽¨<⍉𝕩, ∾+˝𝕨𝔽𝔾𝕩, ∾+˝𝕨𝔽𝔾⌽⍉𝕩⟩}((+⌜´¨)) inp
zwei+´{ts¨<(˘∨=⌜˜3)/𝕩}2 33inp
einst {+´+´¨+´𝕨𝔽¨<𝕩, +´𝕨𝔽¨<⍉𝕩, ∾+˝𝕨𝔽𝔾𝕩, ∾+˝𝕨𝔽𝔾⌽⍉𝕩⟩}(⊢⊔˜·+⌜´¨) inp
xm˘∨=⌜˜3zwei+´{ts¨<xm/𝕩}2 33inp
}
IV _is 4

0 comments on commit f44b7f7

Please sign in to comment.