Handbook
Glossary
count-neighbors ( cells row col quot: ( cell -- ? ) -- n )
Vocabulary
minesweeper
Inputs
cells
an
object
row
an
object
col
an
object
quot
a
quotation
with stack effect
( cell -- ? )
Outputs
n
an
object
Definition
USING:
kernel
math
sequences
;
IN:
minesweeper
::
count-neighbors
( cells row col quot: ( cell -- ? ) -- n )
cells
neighbors
[
first2
[
row
+
]
[
col
+
]
bi*
cell-at
quot
[
f
]
if*
]
with
count
;
inline