@ -69,7 +69,13 @@ public class GameLogic {
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++) {
return finished;
@ -205,7 +205,11 @@ class GameLogicTest {
Arguments.of("check diagonal left win for player 1", 'x', true, new char[][]
{{'x', 'o', 'x'},
{'x', 'x', 'o'},
{'o', 'o', 'x'}})
{'o', 'o', 'x'}}),
Arguments.of("check diagonal right win for player 2", 'o', true, new char[][]
{{'x', 'x', 'o'},
{'x', 'o', 'o'},
{'o', 'x', 'x'}})
);