September Morn Update

This commit is contained in:
Ingy döt Net 2019-09-12 10:33:56 -07:00
parent 4e2d22a71d
commit aac6731f2c
6856 changed files with 141342 additions and 21127 deletions

View file

@ -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 .