 M: grid-gadget draw-gadget*
     [ update-grid ] [ draw-cells ] [ draw-lines ] tri ;
 
+SYMBOL: last-click
+
 :: on-click ( gadget -- )
     gadget size>> :> size
     gadget grid>> grid-dim :> ( rows cols )
     gadget hand-rel first2 [ size /i ] bi@ :> ( i j )
     i 0 cols 1 - between?
     j 0 rows 1 - between? and [
-        i j gadget grid>> nth [ not ] change-nth
+        i j gadget grid>> nth
+        [ not dup last-click set ] change-nth
     ] when gadget relayout-1 ;
 
 :: on-drag ( gadget -- )

    grid count-neighbors :> neighbors
    grid [| row j |
        row [| cell i |
            i j neighbors nth nth :> n
            cell [
                n 2 3 between? i j grid nth set-nth
            ] [
                n 3 = [
                    t i j grid nth set-nth
                ] when
            ] if
        ] each-index
    ] each-index ;

        20 >>size
        dup '[ _ [ grid>> next-step ] [ relayout-1 ] bi ]
        f 1/5 seconds <timer> >>timer ;

M: grid-gadget ungraft*
    [ timer>> stop-timer ] [ call-next-method ] bi ;
