diff --git a/src/othello/players/AlphaBetaPlayer.java b/src/othello/players/AlphaBetaPlayer.java index c9d780b..9dff484 100644 --- a/src/othello/players/AlphaBetaPlayer.java +++ b/src/othello/players/AlphaBetaPlayer.java @@ -23,7 +23,6 @@ public class AlphaBetaPlayer extends Player{ Pair bestMove = null; for(Pair 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 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;