]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/tetris/tetromino/tetromino.factor
Harmonize spelling
[factor.git] / extra / tetris / tetromino / tetromino.factor
index 957f808aaef78f3532c19ba679dfa1a9a0f4ef55..8ef06eb173cd74d91091c64c3fbcfe20f591e86c 100644 (file)
@@ -1,10 +1,11 @@
-! Copyright (C) 2006, 2007 Alex Chapman
+! Copyright (C) 2006, 2007, 2008 Alex Chapman
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel arrays namespaces sequences math math.vectors
-colors random ;
+
+USING: colors math namespaces random sequences ;
+
 IN: tetris.tetromino
 
-TUPLE: tetromino states colour ;
+TUPLE: tetromino states color ;
 
 C: <tetromino> tetromino
 
@@ -14,13 +15,13 @@ SYMBOL: tetrominoes
   [
     { {
         { 0 0 } { 1 0 } { 2 0 } { 3 0 }
-      } 
+      }
       { { 0 0 }
         { 0 1 }
         { 0 2 }
         { 0 3 }
       }
-    } cyan
+    } COLOR: cyan
   ] [
     {
       {         { 1 0 }
@@ -37,11 +38,11 @@ SYMBOL: tetrominoes
         { 0 1 } { 1 1 }
                 { 1 2 }
       }
-    } purple
+    } COLOR: purple
   ] [
     { { { 0 0 } { 1 0 }
         { 0 1 } { 1 1 } }
-    } yellow
+    } COLOR: yellow
   ] [
     {
       { { 0 0 } { 1 0 } { 2 0 }
@@ -58,9 +59,9 @@ SYMBOL: tetrominoes
         { 0 1 }
         { 0 2 } { 1 2 }
       }
-    } orange
+    } COLOR: orange
   ] [
-    { 
+    {
       { { 0 0 } { 1 0 } { 2 0 }
                         { 2 1 }
       } {
@@ -75,7 +76,7 @@ SYMBOL: tetrominoes
         { 0 1 }
         { 0 2 }
       }
-    } blue
+    } COLOR: blue
   ] [
     {
       {          { 1 0 } { 2 0 }
@@ -85,7 +86,7 @@ SYMBOL: tetrominoes
         { 0 1 } { 1 1 }
                 { 1 2 }
       }
-    } green
+    } COLOR: green
   ] [
     {
       {
@@ -96,19 +97,18 @@ SYMBOL: tetrominoes
         { 0 1 } { 1 1 }
         { 0 2 }
       }
-    } red
+    } COLOR: red
   ]
-} [ call <tetromino> ] map tetrominoes set-global
+} [ first2 <tetromino> ] map tetrominoes set-global
 
 : random-tetromino ( -- tetromino )
     tetrominoes get random ;
 
 : blocks-max ( blocks quot -- max )
-    map [ 1+ ] map supremum ; inline
+    map supremum 1 + ; inline
 
 : blocks-width ( blocks -- width )
     [ first ] blocks-max ;
 
 : blocks-height ( blocks -- height )
     [ second ] blocks-max ;
-