I need to check if a 2d array is full and if it is a latin square. I have two methods to check for both conditions but when I put the check in the do while loop it doesn't check. I want the game to stop if the board is full then proceed to check if it is a latin square. I set it up to where it checks for an empty element in the array. This is the code for the fullboard check.
public static boolean fullBoard(char [][] square){
for(int i = 0; i < square.length; i++){
for(int j = 0; j < square.length; j++){
if(square[i][j] == 0) {
return false;
}
}
}
return true;
}
This is the code for the do while:
do {
promptUser(square);
printBoard(square);
if(fullBoard(square)) {
isLatinSquare(square);
}
}while(isLatinSquare(square));
System.out.println("you win");
printBoard(square);
}