before big code modification (moving player color in Board)
This commit is contained in:
@ -9,7 +9,7 @@ import suicideChess.Square.NotAValidSquare;
|
||||
/**
|
||||
* This class will contain all the AI.
|
||||
* @author Jean-Baptiste Hétier
|
||||
* @version $LastChangedRevision: 33 $, $LastChangedDate: 2006-01-13 17:03:06 +0000 (Fri, 13 Jan 2006) $
|
||||
* @version $LastChangedRevision$, $LastChangedDate$
|
||||
*/
|
||||
|
||||
public class ComputerPlayer {
|
||||
@ -52,7 +52,11 @@ public class ComputerPlayer {
|
||||
*/
|
||||
public static Move doMinMaxMove(Board bitboard, int color) throws NotAValidSquare, NoPieceOnSquare {
|
||||
bestMove = null;
|
||||
MinMax(bitboard, color, 0);
|
||||
nodesSearched = 0;
|
||||
int bestScore = MinMax(bitboard, color, 0);
|
||||
if (SuicideChess.postThinkingOutput()) {
|
||||
System.out.println(SuicideChess.PLY_DEPTH+" "+bestScore*100+" 0 "+nodesSearched+" "+bestMove);
|
||||
}
|
||||
return bestMove;
|
||||
}
|
||||
|
||||
@ -61,6 +65,9 @@ public class ComputerPlayer {
|
||||
if (currentDepth >= SuicideChess.PLY_DEPTH) {
|
||||
return bitboard.getBoardValue();
|
||||
}
|
||||
|
||||
nodesSearched++;
|
||||
|
||||
Rules.legalMovesForPlayer(bitboard,color);
|
||||
ArrayList<Move> allLegalMoves = Rules.getLegalMovesCapture();
|
||||
if (allLegalMoves.size()==0) {
|
||||
@ -105,4 +112,5 @@ public class ComputerPlayer {
|
||||
}
|
||||
|
||||
private static Move bestMove = null;
|
||||
private static int nodesSearched;
|
||||
}
|
Reference in New Issue
Block a user