     neighbors [
         first2 [ row + ] [ col + ] bi* :> ( row' col' )
         cells row' col' cell-at [
-            { [ mined?>> ] [ state>> +flagged+ = ] } 1|| [
+            mined?>> [
                 cells row' col' click-cell-at drop
             ] unless
         ] when*

    gadget cells>> [| row col cell |
        col row [ 32 * ] bi@ 58 + 2array [
            cell game-over? cell-image-path
            gadget cached-texture
            { 32 32 } swap draw-scaled-texture
        ] with-translation
    ] each-cell ;


        [ "vocab:minesweeper/_resources/smiley.gif" ]
    } cond ;

: draw-cached-texture ( path gadget -- )
    textures>> [ load-image { 0 0 } <texture> ] cache
    [ dim>> [ 2 /i ] map ] [ draw-scaled-texture ] bi ;

:: draw-mines ( n gadget -- )
    n "%03d" sprintf [
        26 * 3 + 6 2array [
            digit-image-path gadget draw-cached-texture
        ] with-translation
    ] each-index ;

:: draw-smiley ( gadget -- )
    gadget pref-dim first :> width
    width 2/ 26 - 3 2array [
        gadget cells>> [ won? ] [ lost? ] bi
        hand-buttons get-global empty? not
        gadget hand-click-rel second 58 >= and
        smiley-image-path gadget draw-cached-texture
    ] with-translation ;

:: draw-timer ( n gadget -- )
    gadget pref-dim first :> width
    n "%03d" sprintf [
        3 swap - 26 * width swap - 3 - 6 2array [
            digit-image-path gadget draw-cached-texture
        ] with-translation
    ] each-index ;

