on-grid ( gadget quot: ( cells row col -- ? ) -- )


Vocabulary
minesweeper

Inputs
gadgetan object
quota quotation with stack effect ( cells row col -- ? )


Outputs
None

Definition


:: on-grid ( gadget quot: ( cells row col -- ? ) -- )
gadget hand-rel first2 :> ( w h ) h 58 >= [
h 58 - w [ 32 /i ] bi@
:> ( row col ) gadget cells>> :> cells cells game-over?
[
cells row col quot call [
gadget start>> [ now gadget start<< ] unless
cells game-over? [ now gadget end<< ] when
] when
] unless
] when gadget relayout-1 ; inline