]> gitweb.factorcode.org Git - factor.git/commitdiff
rosetta-code.bulls-and-cows: digit> is better.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 14 Aug 2012 01:17:03 +0000 (18:17 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 14 Aug 2012 01:17:03 +0000 (18:17 -0700)
extra/rosetta-code/bulls-and-cows/bulls-and-cows.factor

index 061fab3c04efb7b0ec91f65cc795553e90fab3e4..af24b1b0d2668510b793236baafb01bffb1a3a7a 100644 (file)
@@ -49,7 +49,7 @@ TUPLE: bull ;
 : narr>nhash ( narr -- nhash ) { 1 2 3 4 } swap zip ;
 
 : num>hash ( n -- hash )
-    [ 1string string>number ] { } map-as narr>nhash ;
+    [ digit> ] { } map-as narr>nhash ;
 
 :: cow-or-bull ( n g -- arr )
     {