diff --git a/src/GomokuAI.java b/src/GomokuAI.java index 29968bf..8c8de09 100644 --- a/src/GomokuAI.java +++ b/src/GomokuAI.java @@ -1,7 +1,7 @@ +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Random; -import java.util.HashMap; public class GomokuAI extends Player { @@ -56,6 +56,7 @@ public class GomokuAI extends Player { } } break; + case 2: Map map2 = GetCellPoint(board, this.color); Color other = null; @@ -76,9 +77,10 @@ public class GomokuAI extends Player { } for (Map.Entry entry : map3.entrySet()) { - if (entry.getValue() > max3) { + if (entry.getValue() > max3 && max2 < entry.getValue()) { max3 = entry.getValue(); playCell = entry.getKey(); + System.out.println("ia a fait un coup pour elle"); } } @@ -99,7 +101,7 @@ public class GomokuAI extends Player { * @return the Map of all Cell playable, and their point. */ public Map GetCellPoint(GomokuBoard board, Color color) { - // Prout + List playableCell = board.getPlayableCells(); Map map = new HashMap<>(); diff --git a/src/GomokuGame.java b/src/GomokuGame.java index 3e89f44..8938399 100644 --- a/src/GomokuGame.java +++ b/src/GomokuGame.java @@ -5,7 +5,6 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.util.Random; -import java.util.Random; public class GomokuGame {