Paste: grid-computing puzzle (from codegolf)
Author: | rand |
Mode: | factor |
Date: | Wed, 1 Jul 2009 14:55:49 |
Plain Text |
: grid-max ( string -- n )
"\n" split [ " " split [ string>number ] map ] map
dup flip
[ [ sum ] map supremum ] bi@ max ;
[ 615 ] [ "01 34 46 31 55 21 16 88 87 87\n32 40 82 40 43 96 08 82 41 86\n30 16 24 18 04 54 65 96 38 48\n32 00 99 90 24 75 89 41 04 01\n11 80 31 83 08 93 37 96 27 64\n09 81 28 41 48 23 68 55 86 72\n64 61 14 55 33 39 40 18 57 59\n49 34 50 81 85 12 22 54 80 76\n18 45 50 26 81 95 25 14 46 75\n22 52 37 50 37 40 16 71 52 17" grid-max ] unit-test
New Annotation