count-neighbors ( cells row col quot: ( cell -- ? ) -- n )


Vocabulary
minesweeper

Inputs
cellsan object
rowan object
colan object
quota quotation with stack effect ( cell -- ? )


Outputs
nan object


Definition


:: count-neighbors
( cells row col quot: ( cell -- ? ) -- n )
cells neighbors
[ first2 [ row + ] [ col + ] bi* cell-at quot [ f ] if* ]
with count ; inline