Merge branch 'master' of gitlab.isima.fr:audorival/gomoku
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user