fixed complexity

This commit is contained in:
Quentin Legot 2021-03-01 08:21:44 +01:00
parent 31e1e2cb5f
commit 509c027b74

View File

@ -23,7 +23,6 @@ public class AlphaBetaPlayer extends Player{
Pair<Point, Point> bestMove = null;
for(Pair<Point, Point> move : game.getMove(game.getCurrentPlayer())) {
State nextState = game.play(move);
complexity++;
int value = -alphabeta(nextState, this.depth,Integer.MIN_VALUE,Integer.MAX_VALUE);
if (value > bestValue) {
bestValue = value;
@ -40,6 +39,7 @@ public class AlphaBetaPlayer extends Player{
else{
for (Pair<Point, Point> move : state.getMove(state.getCurrentPlayer())) {
State nextState = state.play(move);
complexity++;
alpha = Math.max(alpha,-alphabeta(nextState,depth-1,-beta,-alpha));
if(alpha >= beta)
return alpha;