Version 1.0.2

=============
Corrected a major but in move ordering
and a major bug in the evaluation function.
This commit is contained in:
2006-07-16 17:17:40 +00:00
parent 399985789e
commit 9c4916fb1b
5 changed files with 203 additions and 49 deletions

View File

@ -25,9 +25,11 @@ class MoveCompare implements Comparator<Move> {
public MoveCompare(Board bitboard) {
this.bitboard = bitboard;
if(this.bitboard.getCurrentPlayer()==Piece.BLACK) {
sortOrder= +1;
// low scores are considered "smaller" than high ones and thus will be first after ordering
sortOrder= -1;
} else {
sortOrder= -1;
// high scores are consideres "smaller" than low ones
sortOrder= +1;
}
}
@ -42,9 +44,9 @@ class MoveCompare implements Comparator<Move> {
} catch (NotAValidSquare e) {
e.printStackTrace();
}
if(oneBoardCopy.getBoardValue()>anotherBoardCopy.getBoardValue()) {
if(oneBoardCopy.getBoardValue()<anotherBoardCopy.getBoardValue()) {
return sortOrder;
} else if (oneBoardCopy.getBoardValue()>anotherBoardCopy.getBoardValue()) {
} else if (oneBoardCopy.getBoardValue()==anotherBoardCopy.getBoardValue()) {
return 0;
}
return -sortOrder;