@@ 197,5 197,11 @@ func (g Game) checkWin(row, col, curPlayer int) int {
return curPlayer
}
}
- return 0
+ for c := 0; c < g.config.Cols; c++ {
+ topRow := g.config.Rows - 1
+ if g.board[topRow][c][0] == 0 || g.board[topRow][c][1] == 0 {
+ return 0 //Not a draw
+ }
+ }
+ return -1 //Draw
}