This commit is contained in:
Aubin DORIVAL
2025-04-14 09:12:35 +02:00
parent 7b2b2e3df8
commit 9a475e74fc

View File

@@ -100,29 +100,6 @@ public class GomokuGame {
* @param bot If the player want to play with a bot it's true. * @param bot If the player want to play with a bot it's true.
* @param name1 Name of player one. * @param name1 Name of player one.
* @param name2 Name of player two. * @param name2 Name of player two.
* =======
*
* // Test
* GomokuGame g = new GomokuGame(renderer);//metre true ou false
* si in veut l'affichage ou non
* if(path_a_load!="")
* {
* g.load(Path.of(path_a_load));
* }
* g.newGame(false, "Player 1", "Player 2", DEFAULT_TOKENS_COUNT);
* g.renderer = new ConsoleRenderer();
* g.renderer.init(g);
* g.board.expandBoard(Cardinal.SE);
* g.renderer.update();
*
* }
*
* /**
* This method init the game with these parameters.
* @param bot If the player want to play with a bot it's true.
* @param name1 Name of player one.
* @param name2 Name of player two.
* >>>>>>> 0b7eea162d3fc3a376c81c37a86ec6fc47ae4493
* @param tokens Number of tokens for each player. * @param tokens Number of tokens for each player.
*/ */
@@ -167,7 +144,7 @@ public class GomokuGame {
while (currentPlay == null) { while (currentPlay == null) {
currentPlay = this.play(this.currentPlayer); currentPlay = this.play(this.currentPlayer);
} }
System.out.println(board.countMax(board.countAlignedCells(currentPlay)));
if (NB_CELL_PLAY <= board.countMax(board.countAlignedCells(currentPlay))) { if (NB_CELL_PLAY <= board.countMax(board.countAlignedCells(currentPlay))) {
this.renderer.updateStatus("Le joueur " + this.currentPlayer + "a gagné !"); this.renderer.updateStatus("Le joueur " + this.currentPlayer + "a gagné !");
return; return;
@@ -176,6 +153,7 @@ public class GomokuGame {
this.currentPlayer = this.nextPlayer(); this.currentPlayer = this.nextPlayer();
System.out.println(this.board); System.out.println(this.board);
} }
this.renderer.updateStatus("Match nul, il ne reste plus de jeton."); this.renderer.updateStatus("Match nul, il ne reste plus de jeton.");
return; return;
} }