]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/rosetta-code/one-d-cellular/one-d-cellular.factor
factor: trim using lists
[factor.git] / extra / rosetta-code / one-d-cellular / one-d-cellular.factor
index 1f3af663935bf9d72773dc0f9a2408de5634fa33..56567f4ba23d9a15f3206fb1f590ff6d7a2e9a61 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (c) 2012 Anonymous
 ! See http://factorcode.org/license.txt for BSD license.
-USING: bit-arrays io kernel locals math sequences ;
+USING: bit-arrays io kernel math sequences ;
 IN: rosetta-code.one-d-cellular
 
 ! http://rosettacode.org/wiki/One-dimensional_cellular_automata
@@ -33,7 +33,7 @@ IN: rosetta-code.one-d-cellular
     index [ 1 - ] [ 1 + ] bi [ world ?nth ] bi@ bool-sum ;
 
 : count-neighbours ( world -- neighbours )
-    [ length iota ] keep [ neighbours ] curry map ;
+    [ length <iota> ] keep [ neighbours ] curry map ;
 
 : life-law ( alive? neighbours -- alive? )
     swap [ 1 = ] [ 2 = ] if ;
@@ -49,4 +49,3 @@ IN: rosetta-code.one-d-cellular
     10 [ dup print-cellular step ] times print-cellular ;
 
 MAIN: main-cellular
-