Skip to content

Commit

Permalink
Swapped min/max again
Browse files Browse the repository at this point in the history
  • Loading branch information
john committed Apr 30, 2016
1 parent 16377f7 commit ed5e750
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/controller/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/controller/GameConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 2 additions & 2 deletions src/model/Board.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ed5e750

Please sign in to comment.