]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/project-euler/081/081.factor
factor: trim using lists
[factor.git] / extra / project-euler / 081 / 081.factor
index 73936ba2ed1510e4ad1db4c8f60fb81f37365b01..5482f516ee2f7cb3e4c2486c276aeed192e095b6 100644 (file)
@@ -1,8 +1,7 @@
 ! Copyright (c) 2009 Guillaume Nargeot.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: fry io.encodings.ascii io.files locals kernel math
-math.order math.parser math.ranges sequences splitting
-project-euler.common ;
+USING: io.encodings.ascii io.files kernel math math.order
+math.parser project-euler.common sequences splitting ;
 IN: project-euler.081
 
 ! http://projecteuler.net/index.php?section=problems&id=081
@@ -45,7 +44,7 @@ IN: project-euler.081
 :: minimal-path-sum-to ( x y matrix -- n )
     x y + zero? [ 0 ] [
         x zero? [ 0 y 1 - matrix get-matrix
-        ] [ 
+        ] [
             y zero? [
                 x 1 - 0 matrix get-matrix
             ] [
@@ -60,7 +59,7 @@ IN: project-euler.081
     3dup minimal-path-sum-to '[ _ + ] change-matrix ;
 
 : (euler081) ( matrix -- n )
-    dup first length iota dup
+    dup first length <iota> dup
     [ pick update-minimal-path-sum ] cartesian-each
     last last ;