Files
project_euler/81/main.ua

24 lines
538 B
Plaintext

# project euler 81
$ 131 & 673 & 234 & 103 & 18
$ 201 & 96 & 342 & 965 & 150
$ 630 & 803 & 746 & 422 & 111
$ 537 & 699 & 497 & 121 & 956
$ 805 & 732 & 524 & 37 & 331
≡◇(⋕°/$"_ & _") ⊜□⊸≠@\n
ε ← # parsed example problem input
# find shortest path to lower right corner
# ? cost-matrix
Sol ← +⋅⊙⊡◡(
⊢path(
⤚⬚∞⊡ +[0_1 1_0] ¤ # get children & costs
| ≍⊙(-1△) # are we at the corner yet?
)
) 0_0
⍤⤙≍ 2427 Sol ε
&fras "cost-matrix.txt"
⊜(⊜⋕⊸≠@,)⊸≠@\n
Sol