Chess - Programming - Search - Quiescence Search

At the end of the main search a more limited quiescence search should be performed.

Despite the fact that quiescence searches are typically very short, about 50%-90% nodes are spent there, so it is worthwhile to apply some pruning there.

int Quiesce( int alpha, int beta ) {
    int stand_pat = Evaluate();
    if( stand_pat >= beta )
        return beta;
    if( alpha < stand_pat )
        alpha = stand_pat;
 
    until( every_capture_has_been_examined )  {
        MakeCapture();
        score = -Quiesce( -beta, -alpha );
        TakeBackMove();
 
        if( score >= beta )
            return beta;
        if( score > alpha )
           alpha = score;
    }
    return alpha;
}

References

http://web.archive.org/web/20120427185347/http://chessprogramming.wikispaces.com/Quiescence+Search

http://web.archive.org/web/20120420061736/http://chessprogramming.wikispaces.com/Pruning