         ] each-index
     ] each-index ;
 
-TUPLE: grid-gadget < gadget grid timer ;
+TUPLE: grid-gadget < gadget grid size timer ;
 
 : <grid-gadget> ( grid -- gadget )
     grid-gadget new
         swap >>grid
+        20 >>size
         dup '[ _ [ grid>> next-step ] [ relayout-1 ] bi ]
         f 1/5 seconds <timer> >>timer ;
 


grid-gadget "gestures" [
    {
        { T{ button-down { # 1 } } [ on-click ] }
        { T{ drag { # 1 } } [ on-drag ] }
    } assoc-union
] change-word-prop


! See http://factorcode.org/license.txt for BSD license

USING: accessors arrays assocs bit-arrays calendar circular
colors.constants combinators fry kernel locals math math.order
math.ranges namespaces opengl random sequences timers ui
ui.commands ui.gadgets ui.gadgets.toolbar ui.gadgets.tracks
ui.gestures ui.render words ;

IN: game-of-life

: make-grid ( rows cols -- grid )
    '[ _ <bit-array> <circular> ] replicate <circular> ;

: grid-dim ( grid -- rows cols )
    [ length ] [ first length ] bi ;
