This commit is contained in:
Cyprien111
2025-03-31 14:22:48 +02:00
parent 001f572858
commit c8ccca4747

View File

@@ -31,7 +31,14 @@ public class GomokuAI extends Player{
playCell = playableCell.get(random.nextInt(playableCell.size())); playCell = playableCell.get(random.nextInt(playableCell.size()));
break; break;
case 1: case 1:
System.out.println("L'IA réflechit..."); Map<GomokuCell, Integer> map = GetCellPoint(board);
int max=0;
for (Map.Entry<GomokuCell, Integer> entry : map.entrySet()) {
if(entry.getValue() > max){
max = entry.getValue();
playCell = entry.getKey();
}
}
default: default:
throw new AssertionError(); throw new AssertionError();
} }
@@ -74,4 +81,6 @@ public class GomokuAI extends Player{
return map; return map;
} }
} }