Skip to content

Commit

Permalink
day16 uiua part b
Browse files Browse the repository at this point in the history
  • Loading branch information
KatieLG committed Dec 16, 2024
1 parent e645bc2 commit e5af634
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
9 changes: 7 additions & 2 deletions AOC/uiua/solutions/day16.ua
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,15 @@ Solve ← (
Moves # Pick from moves with costs
| ≍End↙₂ # keep going until on the Ending
)
◌ # discard the paths, keeping only the cost
)

# Part A
Input # Grid
⊂Start Dir # Start position and start direction
Solve # solve for cost
◌Solve # solve and discard paths for cost only

# Part A
Input # Grid
⊂Start Dir # Start position and start direction
⊙◌Solve # solve and discard cost for paths
⧻◴≡↙₂/◇⊂ # find all points that lie on a best path
7 changes: 6 additions & 1 deletion AOC/uiua/tests/test_solutions.ua
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ Expected ← (
[31589 98080815200063] # day 13
[222208000 7623] # day 14
[1406628 1432781] # day 15
[85420 492] # day 16
]
)
SolutionMap ← map+1⇡15 Expected
SolutionMap ← map+1⇡⊸⧻Expected
GetSolution ← get⊙SolutionMap

TestDay ← (
Expand Down Expand Up @@ -85,3 +86,7 @@ TestDay 14

# TODO
SkipDay 15 "Not done yet"

now
~ "../solutions/day16.ua"
TestDay 16

0 comments on commit e5af634

Please sign in to comment.