diff --git a/src/model/Board.java b/src/model/Board.java index ba0ea40..6aa14cb 100755 --- a/src/model/Board.java +++ b/src/model/Board.java @@ -387,10 +387,10 @@ public boolean isPromotionLocation(Location location) { location.row == BOARD_SIZE - 1 ); } - public int getHeuristic(Color color) { + public double getHeuristic(Color color) { /* Kings are weighted more, so we count for them twice */ - int blackHeuristic = blackPieces + blackKings; - int whiteHeuristic = whitePieces + whiteKings; + double blackHeuristic = blackPieces + blackKings * 1.5; + double whiteHeuristic = whitePieces + whiteKings * 1.5; return - (color == Color.BLACK ? (blackHeuristic - whiteHeuristic) : (whiteHeuristic - blackHeuristic));