All,
I wonder if anyone has an opinion on this. What's better, this:
// Diagonal checks
if (board[0][0] == turn) {
if (board[1][1] == turn) {
if (board[2][2] == turn) {
System.out.println();
System.out.println(turn + " IS THE WINNER!!!");
writeBoard();
return true;
}
}
}
Or this:
// Diagonal checks
if ((board[0][0] == turn) && (board[1][1] == turn) && (board[2][2] == turn)) {
System.out.println();
System.out.println(turn + " IS THE WINNER!!!");
writeBoard();
return true;
}
This is one of those cases where I'm never sure which way to go. Does anyone have a preference and a good reason for it?
Thanks,
Bill