24 lines
526 B
Plaintext
24 lines
526 B
Plaintext
# project euler 83
|
|
|
|
$ 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(
|
|
⤚⬚∞⊡ +A₂ ¤ # get children & costs
|
|
| ≍⊙(-1△) # are we at the corner yet?
|
|
)
|
|
) 0_0
|
|
⍤⤙≍ 2297 Sol ε
|
|
|
|
&fras "cost-matrix.txt"
|
|
⊜(⊜⋕⊸≠@,)⊸≠@\n
|
|
Sol
|