Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Swapped min and max. Even I can't beat it now.
  • Loading branch information
Aaron committed May 3, 2016
1 parent 9d53eac commit 102b269
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/player/ComputerPlayer.java
Expand Up @@ -100,6 +100,7 @@ public class ComputerPlayer extends Player {
boardFrontier = b.generateJumpFrontierForPiece(b.getLastPieceMoved());
/* If we can't jump anymore, get out of the jump sequence */
if (boardFrontier.isEmpty()) {
inJumpSequence = false;
return getMinimaxScore(otherColor, b, depth-1, inJumpSequence);
}
} else {
Expand Down Expand Up @@ -127,12 +128,12 @@ public class ComputerPlayer extends Player {
}

if (color == GameConstants.THUNK_COLOR) {
// Maximize
return Collections.max(moveScores);
// Minimize over the opponent's scores
return Collections.min(moveScores);
}
else {
// Minimize
return Collections.min(moveScores);
// Assume the opponent maximizes their score.
return Collections.max(moveScores);
}

}
Expand Down

0 comments on commit 102b269

Please sign in to comment.