From: Fabian Fichter Date: Mon, 4 May 2020 20:38:20 +0000 (+0200) Subject: Consider Janggi cannon capture restrictions in SEE X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=8154eeb510c43fca127c88faab71031d78fce73e;p=fairystockfish.git Consider Janggi cannon capture restrictions in SEE Closes #106. --- diff --git a/src/position.cpp b/src/position.cpp index 05e89b1..73698b2 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -743,6 +743,9 @@ Bitboard Position::slider_blockers(Bitboard sliders, Square s, Bitboard& pinners if (b && (!more_than_one(b) || ((AttackRiderTypes[type_of(piece_on(sniperSq))] & HOPPING_RIDERS) && popcount(b) == 2))) { + // Janggi cannons block each other + if ((pieces(JANGGI_CANNON) & sniperSq) && (pieces(JANGGI_CANNON) & blockers)) + blockers &= pieces(JANGGI_CANNON); blockers |= b; if (b & pieces(color_of(piece_on(s)))) pinners |= sniperSq; @@ -1718,6 +1721,10 @@ bool Position::see_ge(Move m, Value threshold) const { attackers |= attacks_bb(~stm, ROOK, to, occupied & ~pieces(ROOK)) & pieces(stm, KING); } + // Janggi cannons can not capture each other + if (type_of(moved_piece(m)) == JANGGI_CANNON && !(attackers & pieces(~stm) & ~pieces(JANGGI_CANNON))) + attackers &= ~pieces(~stm, JANGGI_CANNON); + while (true) { stm = ~stm;