diff --git a/src/controller/Game.java b/src/controller/Game.java index 8f03922..60b82b8 100755 --- a/src/controller/Game.java +++ b/src/controller/Game.java @@ -198,11 +198,11 @@ public int getMinimaxScore(Color color, Board b, int depth, boolean inJumpSequen if (color == GameConstants.THUNK_COLOR) { // Maximize - return Collections.min(moveScores); + return Collections.max(moveScores); } else { // Minimize - return Collections.max(moveScores); + return Collections.min(moveScores); } } diff --git a/src/controller/GameConstants.java b/src/controller/GameConstants.java index 989e7fe..f088570 100644 --- a/src/controller/GameConstants.java +++ b/src/controller/GameConstants.java @@ -8,5 +8,5 @@ public class GameConstants { public static final Color THUNK_COLOR = Color.WHITE; public static final Color USER_COLOR = Color.BLACK; public static final int MAX_PASSIVE_MOVES = 50; - public static final int MAX_SEARCH_DEPTH = 5; + public static final int MAX_SEARCH_DEPTH = 7; } diff --git a/src/model/Board.java b/src/model/Board.java index 131cec7..ba0ea40 100755 --- a/src/model/Board.java +++ b/src/model/Board.java @@ -391,9 +391,9 @@ public int getHeuristic(Color color) { /* Kings are weighted more, so we count for them twice */ int blackHeuristic = blackPieces + blackKings; int whiteHeuristic = whitePieces + whiteKings; - return color == Color.BLACK ? + return - (color == Color.BLACK ? (blackHeuristic - whiteHeuristic) : - (whiteHeuristic - blackHeuristic); + (whiteHeuristic - blackHeuristic)); } public Piece getPiece(Location location) {