From f16448bdf06b1c580f6c00938ac73d88cc1596b1 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Tue, 14 Mar 2023 12:53:50 -0700 Subject: [PATCH] Fix AI value system --- src/ChessAI.java | 2 +- src/King.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ChessAI.java b/src/ChessAI.java index d21a4b3..24b642e 100644 --- a/src/ChessAI.java +++ b/src/ChessAI.java @@ -56,7 +56,7 @@ public class ChessAI { Score score = new Score(); board.forEachPiece((coordinate, piece) -> { if (!piece.black) { - score.add(piece.getValue()); + score.add(-piece.getValue()); } else { score.add(piece.getValue()); } diff --git a/src/King.java b/src/King.java index d98631a..cbf987a 100644 --- a/src/King.java +++ b/src/King.java @@ -6,7 +6,7 @@ public class King extends Piece { } public int getValue() { - return Integer.MAX_VALUE; + return 12; } public ArrayList getPossibleMoves(BoardCoordinate position, Board board) {