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

This commit is contained in:
Dorian HAMDANI
2025-04-14 10:44:59 +02:00

View File

@@ -11,7 +11,7 @@ public class GomokuGame {
public static final int DEFAULT_BOARD_WIDTH = 15; // largeur du plateau 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_BOARD_HEIGHT = 15; // hauteur du plateau
public static final int DEFAULT_TOKENS_COUNT = 60; // nb de jetons public static final int DEFAULT_TOKENS_COUNT = 60; // nb de jetons
public static final int NB_CELL_PLAY = 5; // nb de jetons public int NB_CELL_PLAY = 5; // nb de jetons
private Player player1; private Player player1;
private Player player2; private Player player2;
@@ -83,8 +83,13 @@ public class GomokuGame {
break; break;
} }
} }
if (sizeY < 3 || sizeX < 3) {
System.out.println("Board is too small !");
return;
}
GomokuGame g = new GomokuGame(false);// metre true ou fals si in veut l'affichage ou non GomokuGame g = new GomokuGame(false);// metre true ou fals si in veut l'affichage ou non
g.renderer = new ConsoleRenderer(); g.renderer = new ConsoleRenderer();
g.NB_CELL_PLAY = nbJetonsAligne;
g.renderer.init(g); g.renderer.init(g);
g.board = new GomokuBoard(sizeX, sizeY); g.board = new GomokuBoard(sizeX, sizeY);
g.board.get(sizeX / 2, sizeY / 2).setState(Color.BLACK); g.board.get(sizeX / 2, sizeY / 2).setState(Color.BLACK);