Fix AI value system

This commit is contained in:
Elnu 2023-03-14 12:53:50 -07:00
parent b4c9ca0105
commit f16448bdf0
2 changed files with 2 additions and 2 deletions

View file

@ -56,7 +56,7 @@ public class ChessAI {
Score score = new Score(); Score score = new Score();
board.forEachPiece((coordinate, piece) -> { board.forEachPiece((coordinate, piece) -> {
if (!piece.black) { if (!piece.black) {
score.add(piece.getValue()); score.add(-piece.getValue());
} else { } else {
score.add(piece.getValue()); score.add(piece.getValue());
} }

View file

@ -6,7 +6,7 @@ public class King extends Piece {
} }
public int getValue() { public int getValue() {
return Integer.MAX_VALUE; return 12;
} }
public ArrayList<BoardCoordinate> getPossibleMoves(BoardCoordinate position, Board board) { public ArrayList<BoardCoordinate> getPossibleMoves(BoardCoordinate position, Board board) {