The current code is supposed to check for the top left to the bottom right (and the other way around).
private boolean checkDiagonal() {
int leftRightCount = 0;
for (int row = 0; row < HEIGHT; row++) {
for (int col = 0; col < WIDTH; col++) {
if (BOARD[row][col].getOwningPlayer() == GAME_STATE.getCurrentPlayer()) {
leftRightCount++;
if (leftRightCount == 4) {
return true;
}
break;
} else {
leftRightCount = 0;
}
// col += row;
}
}
return false;
}
These are the indices that need to be checked
row,col
0,0
1,1
2,2
3,3
4,4