September Morn Update
This commit is contained in:
parent
4e2d22a71d
commit
aac6731f2c
6856 changed files with 141342 additions and 21127 deletions
|
|
@ -0,0 +1,14 @@
|
|||
USING: grouping.extras io.encodings.utf8 io.files kernel
|
||||
math.order math.parser math.vectors prettyprint sequences
|
||||
splitting ;
|
||||
IN: rosetta-code.maximum-triangle-path-sum
|
||||
|
||||
: parse-triangle ( path -- seq )
|
||||
utf8 file-lines [ " " split harvest ] map
|
||||
[ [ string>number ] map ] map ;
|
||||
|
||||
: max-triangle-path-sum ( seq -- n )
|
||||
<reversed> unclip-slice [ swap [ max ] 2clump-map v+ ]
|
||||
reduce first ;
|
||||
|
||||
"triangle.txt" parse-triangle max-triangle-path-sum .
|
||||
Loading…
Add table
Add a link
Reference in a new issue