bot alpha-beta + correctif + debut bot divin
This commit is contained in:
@@ -14,7 +14,8 @@ public class Main {
|
||||
String[] options = {
|
||||
"joueur vs joueur",
|
||||
"joueur vs botidiot",
|
||||
"joueur vs bot alpha"
|
||||
"joueur vs bot alpha",
|
||||
"joueur vs bot divin (NON IMPLEMENTE)"
|
||||
};
|
||||
|
||||
int choice = JOptionPane.showOptionDialog(
|
||||
@@ -28,20 +29,38 @@ public class Main {
|
||||
options[0]
|
||||
);
|
||||
|
||||
if (choice == -1) System.exit(0);
|
||||
|
||||
GameMode mode;
|
||||
if (choice == 1) mode = GameMode.PVBOT;
|
||||
else if (choice == 2) mode = GameMode.PVALPHA;
|
||||
else if (choice == 3) mode = GameMode.PVGOD;
|
||||
else mode = GameMode.PVP;
|
||||
|
||||
// Si alpha choisi : non implémenté, on prévient et on lance en PVP (préparation).
|
||||
if (mode == GameMode.PVALPHA) {
|
||||
JOptionPane.showMessageDialog(
|
||||
// Pour ALPHA et GOD : demander une profondeur
|
||||
if (mode == GameMode.PVALPHA || mode == GameMode.PVGOD) {
|
||||
|
||||
String s = JOptionPane.showInputDialog(
|
||||
null,
|
||||
"Bot Alpha-Beta non implémenté pour l'instant.\nLancement en joueur vs joueur.",
|
||||
"Information",
|
||||
JOptionPane.INFORMATION_MESSAGE
|
||||
"Profondeur de recherche ?\n(Conseil 4)",
|
||||
(mode == GameMode.PVGOD ? "Bot Divin (PVGOD)" : "Bot Alpha-Beta"),
|
||||
JOptionPane.QUESTION_MESSAGE
|
||||
);
|
||||
mode = GameMode.PVP;
|
||||
|
||||
int depth = 4; // défaut
|
||||
if (s != null) {
|
||||
try { depth = Integer.parseInt(s.trim()); }
|
||||
catch (Exception ignored) { depth = 4; }
|
||||
} else {
|
||||
// Annulation : on revient en PVP
|
||||
new AvalamWindow(GameMode.PVP);
|
||||
return;
|
||||
}
|
||||
|
||||
if (depth < 1) depth = 1;
|
||||
|
||||
new AvalamWindow(mode, depth);
|
||||
return;
|
||||
}
|
||||
|
||||
new AvalamWindow(mode);
|
||||
|
||||
Reference in New Issue
Block a user