Handbook
Glossary
click-cell-at ( cells row col -- ? )
Vocabulary
minesweeper
Inputs
cells
an
object
row
an
object
col
an
object
Outputs
?
an
object
Definition
USING:
accessors
combinators.short-circuit
kernel
sequences
;
IN:
minesweeper
::
click-cell-at
( cells row col -- ? )
cells row col
cell-at
[
cells
new-game?
[
dup
mined?>>
[
cells
unmined-cell
t
>>mined?
drop
f
>>mined?
cells
update-counts
drop
]
when
]
when
dup
state>>
{
+clicked+
+flagged+
}
member?
[
drop
f
]
[
+clicked+
>>state
{
[
mined?>>
not
]
[
#adjacent>>
0
=
]
}
1&&
[
cells row col
click-cells-around
]
when
t
]
if
]
[
f
]
if*
;