Game Development Reference
In-Depth Information
MovesDown(ss).Add(finalss, finalss.ToString)
Neighbors(ss).Add(finalss, finalss.ToString)
End If
Else
'This is an odd numbered row.
'Same concepts, different numbers.
'Always an even row above, do the moves up.
'The first col lacks the
'neighbors to the left.
If col <> 0 Then
'up and left.
finalss = ss - 5
MovesUp(ss).Add(finalss, finalss.ToString)
Neighbors(ss).Add(finalss, finalss.ToString)
End If
'The move up and right we always get
finalss = ss - 4
MovesUp(ss).Add(finalss, finalss.ToString)
Neighbors(ss).Add(finalss, finalss.ToString)
'Moves down.
If row < 7 Then
'down and right.
finalss = ss + 4
MovesDown(ss).Add(finalss, finalss.ToString)
Neighbors(ss).Add(finalss, finalss.ToString)
If col <> 0 Then
'down and left.
finalss = ss + 3
MovesDown(ss).Add(finalss, finalss.ToString)
Neighbors(ss).Add(finalss, finalss.ToString)
End If
End If
End If
Next col
Next row
End Sub
Moves and neighbors are only part of the checkerboard. We still have the gra-
phical parts, and we still need to decide what we will pass around to the AI. We
Search Nedrilad ::




Custom Search