]> gitweb.factorcode.org Git - factor.git/commitdiff
Use Wolfram's standard convention for rule names
authorwayo.cavazos <wayo.cavazos@gmail.com>
Sun, 2 Jul 2006 11:39:37 +0000 (11:39 +0000)
committerwayo.cavazos <wayo.cavazos@gmail.com>
Sun, 2 Jul 2006 11:39:37 +0000 (11:39 +0000)
contrib/automata.factor

index 46800ddccaf2fa32fdde04b3c03b37bf88f8861a..ddd725b551693ea6bd7928c4ca8d248f83ba9be0 100644 (file)
@@ -5,7 +5,7 @@
 ! This will open a new window that will display a random automata rule
 ! every 10 seconds. Resize the window to make the display larger.
 
-REQUIRES: slate ;
+REQUIRES: math slate ;
 
 USING: parser kernel hashtables namespaces sequences math io
 math-contrib threads strings arrays prettyprint gadgets slate ;
@@ -21,14 +21,14 @@ SYMBOL: rule
 : init-rule ( -- ) 8 <hashtable> rule set ;
 
 : rule-keys ( -- { ... } )
-{ { 0 0 0 }
-  { 0 0 1 }
-  { 0 1 0 }
-  { 0 1 1 }
-  { 1 0 0 }
-  { 1 0 1 }
+{ { 1 1 1 }
   { 1 1 0 }
-  { 1 1 1 } } ;
+  { 1 0 1 }
+  { 1 0 0 }
+  { 0 1 1 }
+  { 0 1 0 }
+  { 0 0 1 }
+  { 0 0 0 } } ;
 
 : rule-values ( n -- { ... } ) >bin 8 CHAR: 0 pad-left >array [ 48 - ] map ;