I have my code working great, just need to know how to determine a tie. It is difficult because I am working with chars to fill the spaces on my tic tac toe board, and am not sure of a way to check if every square has either an 'X' or an 'O' and if all the squares do, make it a tie.
This is my code so far:
Thanks!
/** Board[][] char filled array with either 'X', 'O' or '-'.
returns true if the game is a tie, false if its not */
public static void Tie (char [] [] Board) //Tie Method
{
for (int row = 0; row < 3; row = row + 1)
{
for (int column = 0; column < 3; column = column + 1)
{
if (Board [row] [column] == 'X' && Board [row] [column] == 'O')
{
System.out.println ("It is a tie. Cats game!") ;
GameOver = true ;
}
}
}
}