minesweeper: re-use click-cells-around.
parent
3c7b0825db
commit
1386489bbc
|
@ -88,10 +88,8 @@ DEFER: click-cell-at
|
||||||
neighbors [
|
neighbors [
|
||||||
first2 [ row + ] [ col + ] bi* :> ( row' col' )
|
first2 [ row + ] [ col + ] bi* :> ( row' col' )
|
||||||
cells row' col' cell-at [
|
cells row' col' cell-at [
|
||||||
mined?>> [
|
cells row' col' click-cell-at drop
|
||||||
cells row' col' click-cell-at drop
|
] when
|
||||||
] unless
|
|
||||||
] when*
|
|
||||||
] each ;
|
] each ;
|
||||||
|
|
||||||
:: click-cell-at ( cells row col -- ? )
|
:: click-cell-at ( cells row col -- ? )
|
||||||
|
@ -125,12 +123,7 @@ DEFER: click-cell-at
|
||||||
cells row col cell-at [
|
cells row col cell-at [
|
||||||
state>> +clicked+ = [
|
state>> +clicked+ = [
|
||||||
cells row col [ adjacent-flags ] [ adjacent-mines ] 3bi = [
|
cells row col [ adjacent-flags ] [ adjacent-mines ] 3bi = [
|
||||||
neighbors [
|
cells row col click-cells-around
|
||||||
first2 [ row + ] [ col + ] bi* :> ( row' col' )
|
|
||||||
cells row' col' cell-at [
|
|
||||||
cells row' col' click-cell-at drop
|
|
||||||
] when
|
|
||||||
] each
|
|
||||||
] when
|
] when
|
||||||
] when t
|
] when t
|
||||||
] [ f ] if* ;
|
] [ f ] if* ;
|
||||||
|
|
Loading…
Reference in New Issue