diff --git a/src/aoc24.org b/src/aoc24.org index 5d52f07..bd45c08 100644 --- a/src/aoc24.org +++ b/src/aoc24.org @@ -155,7 +155,7 @@ to get more context. These definitions and imports are shared by the various puz VIII ← { n ← ≠⊑inp‿ant ← (⊢⋈1↓⍷∘⥊)>•FLines Input𝕩 _tcd ← {(𝕨⊸×-(𝕨-1)×⊣)⌜˜⊸𝔽/○⥊⟜(↕≢)𝕩} - eins ⇐ +´(∧´≥⟜0∧<⟜n)¨⍷∾ 2 (⥊∘⊣/˜·¬⥊⊸∊)_tcd¨ ant=p←⊑1⊐˜(≠cf)≤+´¨¯1=1⊸⊏ds? + ds↩{cf«𝕩}⌾(1‿p⊸⊑){¯1¨𝕩}⌾(0‿n⊸⊑)ds⋄@ + ;@}´˘(⊢≍˘˜·⌽⊒˜)⌽⊏ds + eins ⇐ {+´/(𝕩-˜≠d)↑(d׬m)+(𝕩↑⌽/f)⌾(m⊸/)m}+´s + zwei ⇐ +´/(⊢ׯ1⊸≠)∾⥊⍉{𝕊⟨⟩:𝕩;(⌽∘⊣∾⊢)´𝕩⊔˜𝕩=¯1}¨⌾(1⊸⊏)ds + } + IX _is 9 +#+end_src + +#+RESULTS: +: ⟨ 6378826667552 6413328569890 ⟩ + #+BEGIN_EXPORT html
⊑∘∞ diff --git a/src/bqn/aoc24.bqn b/src/bqn/aoc24.bqn index 853c22d..7abaef0 100644 --- a/src/bqn/aoc24.bqn +++ b/src/bqn/aoc24.bqn @@ -69,7 +69,18 @@ VII _is 7 VIII ← { n ← ≠⊑inp‿ant ← (⊢⋈1↓⍷∘⥊)>•FLines Input𝕩 _tcd ← {(𝕨⊸×-(𝕨-1)×⊣)⌜˜⊸𝔽/○⥊⟜(↕≢)𝕩} - eins ⇐ +´(∧´≥⟜0∧<⟜n)¨⍷∾ 2 (⥊∘⊣/˜·¬⥊⊸∊)_tcd¨ ant=p←⊑1⊐˜(≠cf)≤+´¨¯1=1⊸⊏ds? + ds↩{cf«𝕩}⌾(1‿p⊸⊑){¯1¨𝕩}⌾(0‿n⊸⊑)ds⋄@ + ;@}´˘(⊢≍˘˜·⌽⊒˜)⌽⊏ds + eins ⇐ {+´/(𝕩-˜≠d)↑(d׬m)+(𝕩↑⌽/f)⌾(m⊸/)m}+´s + zwei ⇐ +´/(⊢ׯ1⊸≠)∾⥊⍉{𝕊⟨⟩:𝕩;(⌽∘⊣∾⊢)´𝕩⊔˜𝕩=¯1}¨⌾(1⊸⊏)ds +} +IX _is 9