From: ianfab Date: Sat, 28 Jul 2018 15:22:39 +0000 (+0200) Subject: Tweak SEE for nCheck and extinction variants X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=612334747632a3ff404cb66e8a7bb7d6159577cf;p=fairystockfish.git Tweak SEE for nCheck and extinction variants 3check STC LLR: 2.96 (-2.94,2.94) [0.00,10.00] Total: 131 W: 115 L: 14 D: 2 extinction STC LLR: 2.97 (-2.94,2.94) [0.00,10.00] Total: 92 W: 90 L: 1 D: 1 --- diff --git a/src/position.cpp b/src/position.cpp index 098a681..e4044d6 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1306,6 +1306,20 @@ bool Position::see_ge(Move m, Value threshold) const { Color stm = ~us; // First consider opponent's move Value balance; // Values of the pieces taken by us minus opponent's ones + + // nCheck + if (max_check_count() && color_of(moved_piece(m)) == sideToMove && gives_check(m)) + return true; + + // Extinction + if ( extinction_value() != VALUE_NONE + && piece_on(to) + && ( ( extinction_piece_types().find(type_of(piece_on(to))) != extinction_piece_types().end() + && pieceCount[piece_on(to)] == 1) + || ( extinction_piece_types().find(ALL_PIECES) != extinction_piece_types().end() + && count(~sideToMove) == 1))) + return extinction_value() < VALUE_ZERO; + // The opponent may be able to recapture so this is the best result // we can hope for. balance = PieceValue[MG][piece_on(to)] - threshold;