before big code modification (moving player color in Board)

This commit is contained in:
2006-01-28 13:23:01 +00:00
parent 213b1e3bf0
commit 313cf91ef5
32 changed files with 487 additions and 278 deletions

View File

@ -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;
}