Skip to content

Commit

Permalink
2024 10 (uiua) refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
memark committed Dec 17, 2024
1 parent a24302b commit 2fd3ac1
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions 2024/day-10/main.ua
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,26 @@

~ "lib.ua" ~ 🏰 👨‍💻‼

Grid ← ⊜≡⍣(⋕|¯1)⊸≠@\n &fras"input.txt"

🏘 ← (
+⊸[∩¯,,⇌.⇡2]¤
▽⊸≡(🏰:△Grid)
)

HeadsAndFeet ← ♭₋₁⊞⊟:⊃(⊚=₉|⊚=₀)

𓈈 ← ⊜≡⍣(⋕|¯1)⊸≠@\n &fras"input.txt"
🏘 ← ▽⊸≡(🏰:△𓈈) +⊸[∩¯,,⇌.⇡2]¤
🦵 ← ♭₋₁⊞⊟:⊃(⊚=₉|⊚=₀)
📐 ← ⍤⤙≍⊙△

# validNeighbors ? current
🔜 ← (
⊸📐[2]
⊸🏘
⊙(+1⊡:Grid) # ta fram värdet+1
▽:⊙=:⊸≡(⊡:Grid) # kolla dess värden
⊙(+1⊡:𓈈)
▽:⊙=:⊸≡(⊡:𓈈)
)

Solve! ← /+^0 ≡(⧻ 👨‍💻‼🔜≍ °⊟₂) HeadsAndFeet
🎠! ← /+^0 ≡(⧻ 👨‍💻‼🔜≍ °⊟₂) 🦵

🐪 ← SolveGrid
🐪 ← 🎠𓈈
┌─╴🧪
⍤⤙≍ 550 🐪
└─╴

🐫 ← Solve!∘ Grid
🐫 ← 🎠!∘ 𓈈
┌─╴🧪
⍤⤙≍ 1255 🐫
└─╴

0 comments on commit 2fd3ac1

Please sign in to comment.