]> gitweb.factorcode.org Git - factor.git/commitdiff
project-euler.186: the build bots can handle it.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 15 Feb 2018 03:34:15 +0000 (19:34 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 15 Feb 2018 03:34:15 +0000 (19:34 -0800)
extra/project-euler/186/186-tests.factor
extra/project-euler/186/186.factor

index 757d92cc746d572fd82f1548dc776cbfc03ef2c3..a7dab4e43566b4d898a5c844b7df9f6704b53917 100644 (file)
@@ -1,4 +1,3 @@
 USING: project-euler.186 tools.test ;
 
-! Uses too much memory; don't want to run on build machines
-! [ 2325629 ] [ euler186 ] unit-test
+[ 2325629 ] [ euler186 ] unit-test
index ea7fad29ce5d2443a75b0b2fe29abb2050b35740..b9812381671ef279b3e877a5f0dce9530eb9823b 100644 (file)
@@ -45,7 +45,7 @@ IN: project-euler.186
     55 [1,b] [ (generator) ] map <circular> ;
 
 : advance ( lag -- )
-    [ { 0 31 } swap nths sum 1000000 rem ] keep circular-push ;
+    [ [ 0 swap nth ] [ 31 swap nth ] bi + 1000000 rem ] keep circular-push ;
 
 : next ( lag -- n )
     [ first ] [ advance ] bi ;