]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/tetris/game/game.factor
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places...
[factor.git] / extra / tetris / game / game.factor
index ef5ffcc3447c48822931394ac41006132d363b52..e1b5867f64ed684ae5095036171bd144b60da824 100644 (file)
@@ -12,8 +12,8 @@ TUPLE: tetris
     { paused? initial: f }
     { running? initial: t } ;
 
-: default-width 10 ; inline
-: default-height 20 ; inline
+CONSTANT: default-width 10
+CONSTANT: default-height 20
 
 : <tetris> ( width height -- tetris )
     dupd <board> swap <piece-llist>
@@ -32,10 +32,10 @@ TUPLE: tetris
     [ not ] change-paused? drop ;
 
 : level>> ( tetris -- level )
-    rows>> 1+ 10 / ceiling ;
+    rows>> 1 + 10 / ceiling ;
 
 : update-interval ( tetris -- interval )
-    level>> 1- 60 * 1000 swap - ;
+    level>> 1 - 60 * 1000 swap - ;
 
 : add-block ( tetris block -- )
     over board>> spin current-piece tetromino>> colour>> set-block ;
@@ -57,7 +57,7 @@ TUPLE: tetris
         { 2 [ 100 ] }
         { 3 [ 300 ] }
         { 4 [ 1200 ] }
-    } case swap 1+ * ;
+    } case swap 1 + * ;
 
 : add-score ( tetris n-rows -- tetris )
     over level>> swap rows-score swap [ + ] change-score ;