Fixed some typos
This commit is contained in:
parent
8283866d62
commit
666a7ea25c
@ -27,7 +27,7 @@ public class AIPlayer extends Player {
|
|||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
count = 0;
|
count = 0;
|
||||||
findBestMove((Board) board.clone(), color, 0);
|
findBestMove((Board) board.clone(), color, 0);
|
||||||
System.out.println("Moved processes: " + count);
|
System.out.println("Moves processed: " + count);
|
||||||
SwingUtilities.invokeLater(() -> game.onMove(this, bestMove));
|
SwingUtilities.invokeLater(() -> game.onMove(this, bestMove));
|
||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
@ -41,7 +41,7 @@ public class AIPlayer extends Player {
|
|||||||
int enemyValue = board.evaluate(color.opposite());
|
int enemyValue = board.evaluate(color.opposite());
|
||||||
int valueChange = teamValue - enemyValue;
|
int valueChange = teamValue - enemyValue;
|
||||||
|
|
||||||
if (depth <= 3 && valueChange >= 0) valueChange -= findBestMove(board, color.opposite(), depth + 1);
|
if (depth < 4) valueChange -= findBestMove(board, color.opposite(), depth + 1);
|
||||||
|
|
||||||
if (valueChange > bestValue) {
|
if (valueChange > bestValue) {
|
||||||
bestValue = valueChange;
|
bestValue = valueChange;
|
||||||
|
@ -40,10 +40,10 @@ public class Game {
|
|||||||
switch (eventType) {
|
switch (eventType) {
|
||||||
case CHECKMATE:
|
case CHECKMATE:
|
||||||
case STALEMATE:
|
case STALEMATE:
|
||||||
System.out.printf("%s in %s!%n", player.color, eventType);
|
System.out.printf("%s in %s!%n", player.color.opposite(), eventType);
|
||||||
break;
|
break;
|
||||||
case CHECK:
|
case CHECK:
|
||||||
System.out.printf("%s in check!%n", player.color);
|
System.out.printf("%s in check!%n", player.color.opposite());
|
||||||
default:
|
default:
|
||||||
boardPanel.repaint();
|
boardPanel.repaint();
|
||||||
players.get(player.color.opposite()).requestMove();
|
players.get(player.color.opposite()).requestMove();
|
||||||
|
Reference in New Issue
Block a user