From 853ddaf47a301df05baa839cd9133afb3818fbeb Mon Sep 17 00:00:00 2001 From: Cyprien111 <105004796+Cyprien111@users.noreply.github.com> Date: Mon, 7 Apr 2025 09:23:57 +0200 Subject: [PATCH] verify victory --- src/GomokuGame.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/GomokuGame.java b/src/GomokuGame.java index df66ebc..f44fed5 100644 --- a/src/GomokuGame.java +++ b/src/GomokuGame.java @@ -11,6 +11,7 @@ public class GomokuGame { public static final int DEFAULT_BOARD_WIDTH = 15; // largeur du plateau public static final int DEFAULT_BOARD_HEIGHT = 15; // hauteur du plateau public static final int DEFAULT_TOKENS_COUNT = 60; // nb de jetons + public static final int NB_CELL_PLAY = 5; // nb de jetons private Player player1; private Player player2; @@ -59,6 +60,12 @@ public class GomokuGame { public void startGame() { + GomokuCell actualPlayedCell = play(player1); + if( NB_CELL_PLAY >= board.countMax(board.countAlignedCells(actualPlayedCell))) + { + System.out.println("c'est gangée !"); + } + } /**