]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/project-euler/116/116.factor
Resolved merge.
[factor.git] / extra / project-euler / 116 / 116.factor
index 174618e1471723c5b76abea869240e7be17d1c59..2766322323c6e8573f9698436371515a3baf9675 100644 (file)
@@ -41,10 +41,10 @@ IN: project-euler.116
     [ length swap - 1- ] keep ?nth 0 or ;
 
 : next ( colortile seq -- )
-     [ nth* ] [ peek + ] [ push ] tri ;
+     [ nth* ] [ last + ] [ push ] tri ;
 
 : ways ( length colortile -- permutations )
-    V{ 1 } clone [ [ next ] 2curry times ] keep peek 1- ;
+    V{ 1 } clone [ [ next ] 2curry times ] keep last 1- ;
 
 : (euler116) ( length -- permutations )
     3 [1,b] [ ways ] with sigma ;