Skip to content

Commit

Permalink
fix: correct stupid bug in 18.
Browse files Browse the repository at this point in the history
  • Loading branch information
Panadestein committed Dec 19, 2024
1 parent 5463457 commit 502f105
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions src/aoc24.org
Original file line number Diff line number Diff line change
Expand Up @@ -472,18 +472,18 @@ At the end, we have identified all tiles that are part of at least one best path
XVIII ← {
n ← 70 ⋄ inp ← >⟨⟩⊸Ints¨•FLines Input𝕩
g ← 1⌾⊑0¨ b ← (1⥊˜1+n‿n) {0⌾(𝕨⊸⊑)𝕩}´<˘1024↑inp
_sym ← {M _𝕣𝕩: ⊑{(𝕨+1)⋈m∧∨´⊢_cnu⊸∾<𝕩}´•_while_{𝕊: ¬⊢´⊢˝⊢´𝕩} 0‿𝕩}
_symv ← {M _𝕣𝕩: 1=⊢´⊢˝{m∧∨´⊢_cnu⊸∾<𝕩}_fp𝕩}
_sym ← {Ms _𝕣𝕩: ⊑{(𝕨+1)⋈ms∧∨´⊢_cnu⊸∾<𝕩}´•_while_{𝕊: ¬⊢´⊢˝⊢´𝕩} 0‿𝕩}
_symv ← {Ms _𝕣𝕩: ⊢´⊢˝{ms∧∨´⊢_cnu⊸∾<𝕩}_fp𝕩}
eins ⇐ b _sym g
zwei ⇐ inp⊏˜⊑{
m ← ⌊𝕨+2÷˜𝕩-𝕨 ⋄ ⟨𝕨‿m,m‿𝕩⟩⊑˜{b 0⌾((𝕩⊏inp)⊸⊑)↩ ⋄ b _symv g}m
}´_fp 1025⋈≠inp
zwei ⇐ inp⊏˜⊑{𝕊l‿r:
⟨l‿m,m‿r⟩⊑˜{si←<˘𝕩↑inp ⋄ (0¨⌾(si⊸⊑)b)_symv g}m ← ⌊2÷˜+´𝕩
}_fp 1024⋈≠inp
}
XVIII _is 18
#+end_src

#+RESULTS:
: "Computed 248 and ⟨ 29 40 ⟩ in 0.0036658128s"
: "Computed 248 and ⟨ 32 55 ⟩ in 0.0038696174s"

#+BEGIN_EXPORT html
<div style="text-align: center; font-size: 2em; padding: 20px 0;">
Expand Down
10 changes: 5 additions & 5 deletions src/bqn/aoc24.bqn
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ XVII _is 17
XVIII ← {
n70inp>⟨⟩Ints¨•FLines Input𝕩
g10¨ b ← (1˜1+nn) {0(𝕨)𝕩}´<˘1024inp
_sym ← {M _𝕣𝕩: {(𝕨+1)m∧∨´_cnu∾<𝕩}´_while_{𝕊: ¬⊢´˝´𝕩} 0𝕩}
_symv ← {M _𝕣𝕩: 1=´˝{m∧∨´_cnu∾<𝕩}_fp𝕩}
_sym ← {Ms _𝕣𝕩: {(𝕨+1)ms∧∨´_cnu∾<𝕩}´_while_{𝕊: ¬⊢´˝´𝕩} 0𝕩}
_symv ← {Ms _𝕣𝕩: ´˝{ms∧∨´_cnu∾<𝕩}_fp𝕩}
einsb _sym g
zweiinp˜{
m𝕨+2÷˜𝕩-𝕨 ⋄ ⟨𝕨m,m𝕩˜{b 0((𝕩inp))↩ ⋄ b _symv g}m
}´_fp 1025⋈≠inp
zweiinp˜{𝕊lr:
lm,mr˜{si<˘𝕩inp ⋄ (0¨(si)b)_symv g}m2÷˜+´𝕩
}_fp 1024⋈≠inp
}
XVIII _is 18

0 comments on commit 502f105

Please sign in to comment.