From 713467047ded6f2236bf68216334f3b150459a6e Mon Sep 17 00:00:00 2001 From: Aubin DORIVAL Date: Mon, 14 Apr 2025 09:37:18 +0200 Subject: [PATCH] game --- src/GomokuBoard.java | 5 +---- src/GomokuGame.java | 3 ++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/GomokuBoard.java b/src/GomokuBoard.java index 4cba30f..e6ac816 100644 --- a/src/GomokuBoard.java +++ b/src/GomokuBoard.java @@ -2,10 +2,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -<<<<<<< HEAD -======= import java.util.EnumMap; ->>>>>>> 20e2f2eaec0f2988bef55ac30d3f0b3f123b171d /** * The board of the game Gomoku. @@ -290,7 +287,7 @@ public class GomokuBoard { int max = 0; for (Map.Entry entry : mapColor.entrySet()) { - if(entry.getValue() > max){ + if (entry.getValue() > max) { max = entry.getValue(); } } diff --git a/src/GomokuGame.java b/src/GomokuGame.java index 789fc51..1b0bd99 100644 --- a/src/GomokuGame.java +++ b/src/GomokuGame.java @@ -85,7 +85,7 @@ public class GomokuGame { } GomokuGame g = new GomokuGame(false);// metre true ou fals si in veut l'affichage ou non g.board = new GomokuBoard(sizeX, sizeY); - g.board.get(sizeX / 2, sizeY / 2).setState(Color.BLACK); + g.board.get(0, 0).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); @@ -146,6 +146,7 @@ public class GomokuGame { } System.out.println(board.countMax(board.countAlignedCells(currentPlay))); if (NB_CELL_PLAY <= board.countMax(board.countAlignedCells(currentPlay))) { + System.out.println("Le joueur " + this.currentPlayer + "a gagné !"); // this.renderer.updateStatus("Le joueur " + this.currentPlayer + "a gagné !"); return; }