Skip to content

Commit

Permalink
feat: full day 8.
Browse files Browse the repository at this point in the history
  • Loading branch information
Panadestein committed Dec 8, 2024
1 parent 2b01d04 commit b3d50cd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/aoc24.org
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,15 @@ to get more context. These definitions and imports are shared by the various puz
#+begin_src bqn :tangle ./bqn/aoc24.bqn
VIII ← {
n ← ≠⊑inp‿ant ← (⊢⋈1↓⍷∘⥊)>•FLines Input𝕩
+´(∧´≥⟜0∧<⟜n)¨⍷∾{
(⍷∘∾⊢/○⥊˜·<⌜˜↕∘≠)(⊣-˜2⊸×){𝔽´¨⌽⊸⋈𝕩‿𝕨}⌜˜/○⥊⟜(↕≢)𝕩
ant=<inp
_tcd ← {(𝕨⊸×-(𝕨-1)×⊣)⌜˜⊸𝔽/○⥊⟜(↕≢)𝕩}
eins ⇐ +´(∧´≥⟜0∧<⟜n)¨⍷∾ 2 (⥊∘⊣/˜·¬⥊⊸∊)_tcd¨ ant=<inp
zwei ⇐ +´(∧´≥⟜0∧<⟜n)¨⍷∾∾ (↕n) ⥊∘⊣_tcd¨⌜<ant=<inp
}
VIII 8
VIII _is 8
#+end_src

#+RESULTS:
: 291
: 291 1015 ⟩

#+BEGIN_EXPORT html
<div style="text-align: center; font-size: 2em; padding: 20px 0;">
Expand Down
8 changes: 4 additions & 4 deletions src/bqn/aoc24.bqn
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ VII _is 7

VIII ← {
n≠⊑inpant ← (⊢⋈1↓⍷)>•FLines Input𝕩
+´(´0∧<n)¨⍷∾{
(∾⊢/˜·<⌜˜)(⊣-˜2×){𝔽´¨𝕩𝕨}⌜˜/(↕≢)𝕩
}¨ant=<inp
_tcd ← {(𝕨×-(𝕨-1)×⊣)⌜˜𝔽/(↕≢)𝕩}
eins+´(´0∧<n)¨⍷∾ 2 (⊣/˜·¬⥊)_tcd¨ ant=<inp
zwei+´(´0∧<n)¨⍷∾∾ (n) _tcd¨⌜<ant=<inp
}
VIII 8
VIII _is 8

0 comments on commit b3d50cd

Please sign in to comment.