Sub ComputerBlocks(x As Int, y As Int, z As Int) As Boolean
'------------------------------------------------------------------------------------
'
' This routine determines whether or not the computer must block the player
' to prevent the player from winning on his or her next move ...
'
'------------------------------------------------------------------------------------
If getBtnText(x) = "" And getBtnText(y) = gstrPlayerLetter And getBtnText(z) = gstrPlayerLetter Then
getBtnText(x) = gstrComputerLetter
Return True
End If
If getBtnText(x) = gstrPlayerLetter And getBtnText(y) = "" And getBtnText(z) = gstrPlayerLetter Then
getBtnText(y) = gstrComputerLetter
Return True
End If
If getBtnText(x) = gstrPlayerLetter And getBtnText(y) = gstrPlayerLetter And getBtnText(z) = "" Then
getBtnText(z) = gstrComputerLetter
Return True
End If
Return False
End Sub