From 509c027b7482b9886c61c5f46995b2197f7f5b22 Mon Sep 17 00:00:00 2001 From: Quentin Legot Date: Mon, 1 Mar 2021 08:21:44 +0100 Subject: [PATCH] fixed complexity --- src/othello/players/AlphaBetaPlayer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;