]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/rosetta-code/n-queens/n-queens.factor
core: Rename iota to <iota> so we can have TUPLE: iota ... ; instead of TUPLE: iota...
[factor.git] / extra / rosetta-code / n-queens / n-queens.factor
index 8b26a812c5d8fc2c27e804dc6cef399ba61e5840..1fcc64799177a2f92f7f1064b64d0b9b1593d690 100644 (file)
@@ -10,7 +10,7 @@ IN: rosetta-code.n-queens
 
 :: safe?  ( board q -- ? )
     [let q board nth :> x
-      q iota [
+      q <iota> [
          x swap
          [ board nth ] keep
          q swap -
@@ -20,10 +20,10 @@ IN: rosetta-code.n-queens
     ] ;
 
 : solution? ( board -- ? )
-    dup length iota [ dupd safe? ] all? nip ;
+    dup length <iota> [ dupd safe? ] all? nip ;
 
 : queens ( n -- l )
-    iota all-permutations [ solution? ] filter ;
+    <iota> all-permutations [ solution? ] filter ;
 
 : queens. ( n -- )
     queens [ [ 1 + "%d " printf ] each nl ] each ;