I am creating a tic tac toe game and have created the board using a single dimension array.
I have the following code but it returns a true even when the board is still empty and a lot mor emoves can be played. Can someone please tell me where I am going wrong. Thanks
public boolean gameIsADraw() {
for (int i = 0; i <= 9; i++) {
if (!board[i].equals(" ")){
if (gameIsAWin() == false) {
}
return true;
}
}
return false;
}
public boolean gameIsAWin() {
for (String s: winningConditions) {
if (winningSituations(s.charAt(0), s.charAt(1), s.charAt(2)) == true){
return true;
}
}
return false;
}