Game Development Reference
In-Depth Information
Figure 7.6
The board after a number of book moves.
'First move must be unmarked.
If FirstSq.Text <> "" Then Return 0
'The follow-up move must be unmarked.
If SecondSq.Text <> "" Then Return 0
'First square needs eight unclicked neighbors.
Dim Sq As Square
For Each Sq In theField.NearNeighbors(FirstSq.R, FirstSq.C)
If Sq.IsRevealed() Then Return 0
Next
'First move looks good, try it.
theField.MoreThoughts("Book First Move attempting R" & _
FirstSq.R.ToString & " C" & FirstSq.C.ToString)
Call FirstSq.LeftClick()
'We took one move.
Return 1
End Function
#End Region
The whole point of this routine is to take a first move and second move pair and
check that this is a good place to take both moves. If the first move has been
taken, the square would be revealed already, and we obviously cannot take the
Search Nedrilad ::




Custom Search