diff --git a/src/controller/Game.java b/src/controller/Game.java index 35e3b86..64b7899 100755 --- a/src/controller/Game.java +++ b/src/controller/Game.java @@ -106,7 +106,7 @@ public Move getThunkMove() { public Move getMinimaxMove(int depth, boolean inJumpSequence) { ArrayList boardFrontier = null; ArrayList moveFrontier = null; - ArrayList moveScores = new ArrayList(); + ArrayList moveScores = new ArrayList(); if (inJumpSequence) { /* Generate the frontier only for the piece that just moves */ @@ -140,7 +140,7 @@ public Move getMinimaxMove(int depth, boolean inJumpSequence) { } /* Determine the maximum minimax score and which move led to that score */ - int maxScore = Integer.MIN_VALUE; + double maxScore = Double.MIN_VALUE; Move bestMove = null; for (int i = 0; i < moveScores.size(); ++i) { @@ -159,9 +159,9 @@ public Move getMinimaxMove(int depth, boolean inJumpSequence) { return bestMove; } - public int getMinimaxScore(Color color, Board b, int depth, boolean inJumpSequence) { + public double getMinimaxScore(Color color, Board b, int depth, boolean inJumpSequence) { ArrayList boardFrontier; - ArrayList moveScores = new ArrayList(); + ArrayList moveScores = new ArrayList(); Color otherColor = (color == Color.BLACK ? Color.WHITE : Color.BLACK); if (depth == 0) { @@ -196,7 +196,7 @@ public int getMinimaxScore(Color color, Board b, int depth, boolean inJumpSequen } for (Board board : boardFrontier) { - int moveScore = getMinimaxScore(nextColor, board, depth - 1, inJumpSequence); + double moveScore = getMinimaxScore(nextColor, board, depth - 1, inJumpSequence); moveScores.add(moveScore); }