@ -53,6 +53,15 @@ public class GameLogic {
}
if(countFields == this.board.length) finished = true;
// check rows
for (int i = 0; i < this.board[0].length; i++) {
for (int j = 0; j < this.board.length; j++) {
if(board[i][j] == player) countFields++;
break;
return finished;
@ -149,7 +149,11 @@ class GameLogicTest {
Arguments.of("check win in row 0 for player 1", 'x', true, new char[][]
{{'x', 'x', 'x'},
{'o', '-', '-'},
{'-', '-', 'o'}})
{'-', '-', 'o'}}),
Arguments.of("check win in row 0 for player 2", 'x', true, new char[][]
{{'o', 'o', 'o'},
{'x', 'o', '-'},
{'-', '-', 'x'}})
);