mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2024-11-27 06:10:28 +01:00
CuckooChess: Fixed broken handling of UCI "searchmoves".
This commit is contained in:
parent
e4b468d88d
commit
7a762d1ff0
|
@ -129,8 +129,8 @@ public class EngineControl {
|
||||||
computeTimeLimit(sPar);
|
computeTimeLimit(sPar);
|
||||||
ponder = false;
|
ponder = false;
|
||||||
infinite = (maxTimeLimit < 0) && (maxDepth < 0) && (maxNodes < 0);
|
infinite = (maxTimeLimit < 0) && (maxDepth < 0) && (maxNodes < 0);
|
||||||
startThread(minTimeLimit, maxTimeLimit, maxDepth, maxNodes);
|
|
||||||
searchMoves = sPar.searchMoves;
|
searchMoves = sPar.searchMoves;
|
||||||
|
startThread(minTimeLimit, maxTimeLimit, maxDepth, maxNodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
final public void startPonder(Position pos, List<Move> moves, SearchParams sPar) {
|
final public void startPonder(Position pos, List<Move> moves, SearchParams sPar) {
|
||||||
|
@ -229,9 +229,8 @@ public class EngineControl {
|
||||||
sc.setStrength(strength, randomSeed);
|
sc.setStrength(strength, randomSeed);
|
||||||
MoveGen.MoveList moves = moveGen.pseudoLegalMoves(pos);
|
MoveGen.MoveList moves = moveGen.pseudoLegalMoves(pos);
|
||||||
MoveGen.removeIllegal(pos, moves);
|
MoveGen.removeIllegal(pos, moves);
|
||||||
if ((searchMoves != null) && (searchMoves.size() > 0)) {
|
if ((searchMoves != null) && (searchMoves.size() > 0))
|
||||||
Arrays.asList(moves.m).retainAll(searchMoves);
|
moves.filter(searchMoves);
|
||||||
}
|
|
||||||
final MoveGen.MoveList srchMoves = moves;
|
final MoveGen.MoveList srchMoves = moves;
|
||||||
onePossibleMove = false;
|
onePossibleMove = false;
|
||||||
if ((srchMoves.size < 2) && !infinite) {
|
if ((srchMoves.size < 2) && !infinite) {
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
|
|
||||||
package chess;
|
package chess;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author petero
|
* @author petero
|
||||||
|
@ -35,6 +37,13 @@ public final class MoveGen {
|
||||||
m = new Move[MAX_MOVES];
|
m = new Move[MAX_MOVES];
|
||||||
this.size = 0;
|
this.size = 0;
|
||||||
}
|
}
|
||||||
|
public final void filter(List<Move> searchMoves) {
|
||||||
|
int used = 0;
|
||||||
|
for (int i = 0; i < size; i++)
|
||||||
|
if (searchMoves.contains(m[i]))
|
||||||
|
m[used++] = m[i];
|
||||||
|
size = used;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user