c'est 'bon'

This commit is contained in:
vaisse
2026-02-06 11:13:37 +01:00
parent c9e559fe12
commit e0a2c2642a
20 changed files with 10 additions and 4 deletions

View File

View File

@@ -1,7 +1,6 @@
package fr.iut_fbleau.HexGame;
import fr.iut_fbleau.GameAPI.*;
import java.util.EnumMap;
import java.util.Scanner;
@@ -11,7 +10,7 @@ import java.util.Scanner;
public class HexMain {
public static void main(String[] args) {
int size = 11;
int size = 7;
if (args.length >= 1) {
try { size = Integer.parseInt(args[0]); } catch (NumberFormatException ignored) {}
}
@@ -19,12 +18,19 @@ public class HexMain {
HexBoard board = new HexBoard(size);
Scanner sc = new Scanner(System.in);
Result res;
EnumMap<Player, AbstractGamePlayer> players = new EnumMap<>(Player.class);
players.put(Player.PLAYER1, new HumanConsolePlayer(Player.PLAYER1, sc));
players.put(Player.PLAYER2, new HumanConsolePlayer(Player.PLAYER2, sc));
AbstractGame game = new AbstractGame(board, players) {};
Result res = game.run();
if (args.length>=2 && args[1].equals("autoplay")) {
Simulation sim = new Simulation(board, players);
res = sim.run();
} else {
AbstractGame game = new AbstractGame(board, players) {};
res = game.run();
}
System.out.println(board);
System.out.println("Résultat (du point de vue de PLAYER1) : " + res);