     gadget relayout-1 ;
 
 :: com-glider ( gadget -- )
-    gadget grid>> glider drop
+    gadget grid>> :> grid
+    { { 2 1 } { 3 2 } { 1 3 } { 2 3 } { 3 3 } }
+    [ first2 grid nth t -rot set-nth ] each
     gadget relayout-1 ;
 
 grid-gadget "toolbar" f {

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

USING: accessors arrays assocs bit-arrays calendar circular
colors.constants fry kernel locals math math.order 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> ;

: glider ( grid -- grid )
    { { 2 1 } { 3 2 } { 1 3 } { 2 3 } { 3 3 } }
    [ first2 pick nth t -rot set-nth ] each ;

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


grid-gadget "gestures" [
    {
        { T{ key-down f { A+ } "F" } [ toggle-fullscreen ] }
        { T{ button-down { # 1 } } [ on-click ] }
        { T{ drag { # 1 } } [ on-drag ] }
        { mouse-scroll [ on-scroll ] }
    } assoc-union
] change-word-prop

