From c8ccca4747f3d83226109de12e9d31cca0ff0178 Mon Sep 17 00:00:00 2001 From: Cyprien111 <105004796+Cyprien111@users.noreply.github.com> Date: Mon, 31 Mar 2025 14:22:48 +0200 Subject: [PATCH] good Ai --- src/GomokuAI.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/GomokuAI.java b/src/GomokuAI.java index 184c255..ce22702 100644 --- a/src/GomokuAI.java +++ b/src/GomokuAI.java @@ -31,7 +31,14 @@ public class GomokuAI extends Player{ playCell = playableCell.get(random.nextInt(playableCell.size())); break; case 1: - System.out.println("L'IA réflechit..."); + Map map = GetCellPoint(board); + int max=0; + for (Map.Entry entry : map.entrySet()) { + if(entry.getValue() > max){ + max = entry.getValue(); + playCell = entry.getKey(); + } + } default: throw new AssertionError(); } @@ -74,4 +81,6 @@ public class GomokuAI extends Player{ return map; } + + }