@Override
protected TwoPlayerMove findBestMove(TwoPlayerMove lastMove, int depth, MoveList list,
SearchWindow window, SearchTreeNode parent) {
int i = 0;
int bestInheritedValue = -SearchStrategy.INFINITY;
TwoPlayerMove selectedMove;
TwoPlayerMove bestMove = (TwoPlayerMove)list.get( 0 );
while ( !list.isEmpty() ) {
TwoPlayerMove theMove = getNextMove(list);
if (pauseInterrupted())
return lastMove;
updatePercentDone(depth, list);
searchable.makeInternalMove( theMove );
SearchTreeNode child = addNodeToTree(parent, theMove, window); i++;
selectedMove = searchInternal( theMove, depth-1,
new SearchWindow(-window.beta, -Math.max(window.alpha, bestInheritedValue)), child );
searchable.undoInternalMove( theMove );
if (selectedMove != null) {
int selectedValue = -selectedMove.getInheritedValue();
theMove.setInheritedValue( selectedValue );
if ( selectedValue > bestInheritedValue ) {
bestMove = theMove;
bestInheritedValue = selectedValue;
if ( alphaBeta_ && bestInheritedValue >= window.beta) {