|
@ -68,9 +68,15 @@ public class GameLogic { |
|
|
for (int i = this.board.length - 1, j = this.board.length - 1; i >= 0 ; i--, j--) { |
|
|
for (int i = this.board.length - 1, j = this.board.length - 1; i >= 0 ; i--, j--) { |
|
|
if (board[i][j] == player) countFields++; |
|
|
if (board[i][j] == player) countFields++; |
|
|
} |
|
|
} |
|
|
|
|
|
if(countFields == this.board.length) return finished = true; |
|
|
|
|
|
countFields = 0; |
|
|
|
|
|
|
|
|
|
|
|
// check diagonal right |
|
|
|
|
|
for (int i = this.board.length - 1, j = 0; i >= 0 ; i--, j++) { |
|
|
|
|
|
if (board[i][j] == player) countFields++; |
|
|
|
|
|
} |
|
|
if(countFields == this.board.length) return finished = true; |
|
|
if(countFields == this.board.length) return finished = true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return finished; |
|
|
return finished; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|