]> gitweb.factorcode.org Git - factor.git/commitdiff
game-of-life: little bit more.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 12 Mar 2018 15:47:31 +0000 (08:47 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 12 Mar 2018 15:47:31 +0000 (08:47 -0700)
extra/game-of-life/game-of-life.factor

index 2d50874fb00cb7aa4c756731b15238b6f59ec68e..fc6afdccf71718b02c8f27809a12cb94522fb962 100644 (file)
@@ -3,10 +3,10 @@
 
 USING: accessors arrays assocs bit-arrays byte-arrays calendar
 colors.constants combinators fry kernel kernel.private locals
-math math.order math.private math.ranges namespaces opengl
-random sequences sequences.private timers ui ui.commands
-ui.gadgets ui.gadgets.toolbar ui.gadgets.tracks ui.gestures
-ui.render words ;
+math math.order math.ranges namespaces opengl random sequences
+sequences.private timers ui ui.commands ui.gadgets
+ui.gadgets.toolbar ui.gadgets.tracks ui.gestures ui.render words
+;
 
 IN: game-of-life
 
@@ -43,9 +43,9 @@ IN: game-of-life
                 i
                 i 1 + 0 max-cols wraparound
 
-                [ [ above [ 1 fixnum+fast ] change-nth-unsafe ] tri@ ]
-                [ nip [ same [ 1 fixnum+fast ] change-nth-unsafe ] bi@ ]
-                [ [ below [ 1 fixnum+fast ] change-nth-unsafe ] tri@ ]
+                [ [ above [ 1 + ] change-nth-unsafe ] tri@ ]
+                [ nip [ same [ 1 + ] change-nth-unsafe ] bi@ ]
+                [ [ below [ 1 + ] change-nth-unsafe ] tri@ ]
                 3tri
             ] when
         ] each-index