Version 1.0.3
============= Corrected a bug in the principal variation first search
This commit is contained in:
@ -28,16 +28,16 @@ public class SuicideChess {
|
||||
/**
|
||||
* does BitBoard.class removePiece function checks if removing piece is legal ?
|
||||
*/
|
||||
public static final boolean BITBOARD_REMOVEPIECE_CHECK_REMOVE = true;
|
||||
public static final boolean BITBOARD_REMOVEPIECE_CHECK_REMOVE = false;
|
||||
/**
|
||||
* does Square.class checks if the strings are valid (is "z9" a valid square ?)
|
||||
*/
|
||||
public static final boolean SQUARE_CHECK_INVALID = true;
|
||||
public static final boolean SQUARE_CHECK_INVALID = false;
|
||||
|
||||
/**
|
||||
* Use mobility in evaluation function (slows the program down a lot)
|
||||
*/
|
||||
public static final boolean USE_MOBILITY = true;
|
||||
public static final boolean USE_MOBILITY = false;
|
||||
|
||||
/**
|
||||
* do move ordering in Alpha-Beta pruning ?
|
||||
@ -94,12 +94,12 @@ public class SuicideChess {
|
||||
/**
|
||||
* Try the primary variation from the earliest iteration first
|
||||
*/
|
||||
public static final boolean PRINCIPAL_VARIATION_FIRST = false;
|
||||
public static final boolean PRINCIPAL_VARIATION_FIRST = true;
|
||||
|
||||
/**
|
||||
* The name to be displayed
|
||||
*/
|
||||
public static final String NAME = "djib's SuShi v1.0.2";
|
||||
public static final String NAME = "djib's SuShi v1.0.3";
|
||||
|
||||
/**
|
||||
* Displays informations in the console.
|
||||
@ -178,11 +178,11 @@ public class SuicideChess {
|
||||
|
||||
private static void displayPlayer(Board bitboard) {
|
||||
if(bitboard.getCurrentPlayer()==Piece.BLACK) {
|
||||
System.out.println("Black: ");
|
||||
System.out.println("-> Black: ");
|
||||
} else {
|
||||
System.out.println("White: ");
|
||||
System.out.println("-> White: ");
|
||||
}
|
||||
|
||||
//bitboard.debug();
|
||||
}
|
||||
|
||||
//this variable is used to decide whether or not the computer should use it's opening book
|
||||
@ -398,6 +398,8 @@ public class SuicideChess {
|
||||
theMove = new Move(whatMove, bitboard);
|
||||
}
|
||||
|
||||
//theMove.display();
|
||||
|
||||
if (testAndDisplayIfWinningOrDrawPosition(bitboard)) {
|
||||
//if board was set in an illegal position
|
||||
System.out.println("Illegal move: "+theMove.toString());
|
||||
@ -430,6 +432,9 @@ public class SuicideChess {
|
||||
if (asciiGame)
|
||||
System.out.println("Capturing is mandatory.");
|
||||
}
|
||||
//bitboard.debug();
|
||||
for (int moveIndex = 0; moveIndex < allLegalMoves.size(); moveIndex++)
|
||||
System.out.println(allLegalMoves.get(moveIndex));
|
||||
System.out.println("Illegal move: "+theMove.toString());
|
||||
} else {
|
||||
bitboard.doMove(allLegalMoves.get(foundMoveIndex));
|
||||
@ -493,6 +498,8 @@ public class SuicideChess {
|
||||
bitboard.display();
|
||||
displayPlayer(bitboard);
|
||||
}
|
||||
computerMove.display();
|
||||
bitboard.debug();
|
||||
}
|
||||
|
||||
if (testAndDisplayIfWinningOrDrawPosition(bitboard)) {
|
||||
|
Reference in New Issue
Block a user