|
@ -48,14 +48,14 @@ public class GameLogic { |
|
|
// check columns |
|
|
// check columns |
|
|
for (int i = 0; i < this.board.length; i++) { |
|
|
for (int i = 0; i < this.board.length; i++) { |
|
|
for (int j = 0; j < this.board[0].length; j++) { |
|
|
for (int j = 0; j < this.board[0].length; j++) { |
|
|
if(board[i][j] == player) countFields++; |
|
|
|
|
|
|
|
|
if(board[i][j] == player) countFields++; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if(countFields == this.board.length) finished = true; |
|
|
if(countFields == this.board.length) finished = true; |
|
|
|
|
|
|
|
|
// check rows |
|
|
// check rows |
|
|
for (int i = 0; i < this.board.length; i++) { |
|
|
|
|
|
for (int j = 0; j < this.board[0].length; j++) { |
|
|
|
|
|
|
|
|
for (int i = 0; i < this.board[0].length; i++) { |
|
|
|
|
|
for (int j = 0; j < this.board.length; j++) { |
|
|
if(board[j][i] == player) countFields++; |
|
|
if(board[j][i] == player) countFields++; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|