Merge branch 'master' of gitlab.isima.fr:audorival/gomoku

This commit is contained in:
Aubin DORIVAL
2025-04-14 09:54:41 +02:00
3 changed files with 69 additions and 67 deletions

View File

@@ -84,11 +84,13 @@ public class GomokuGame {
}
}
GomokuGame g = new GomokuGame(false);// metre true ou fals si in veut l'affichage ou non
g.renderer = new ConsoleRenderer();
g.renderer.init(g);
g.board = new GomokuBoard(sizeX, sizeY);
g.board.get(sizeX / 2, sizeY / 2).setState(Color.BLACK);
g.player1 = new Human("un", Color.WHITE, nbToken);
g.player2 = new GomokuAI("deux", Color.BLACK, nbToken - 1);
System.out.println(g.board);
//System.out.println(g.board);
// g.renderer.update();
g.startGame();
@@ -139,6 +141,7 @@ public class GomokuGame {
* }
*/
this.currentPlayer = player1;
renderer.update();
while (this.player1.tokens > 0 || this.player2.tokens > 0) {
GomokuCell currentPlay = null;
while (currentPlay == null) {
@@ -152,7 +155,8 @@ public class GomokuGame {
}
this.currentPlayer.tokens -= 1;
this.currentPlayer = this.nextPlayer();
System.out.println(this.board);
renderer.update();
//System.out.println(this.board);
}
// this.renderer.updateStatus("Match nul, il ne reste plus de jeton.");