From: Fabian Fichter Date: Fri, 3 Apr 2020 20:05:23 +0000 (+0200) Subject: Consider palace moves in evaluation X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=346fb60a4252eaaf12f200aa6ddbc083bb7e977b;p=fairystockfish.git Consider palace moves in evaluation janggi LLR: 2.97 (-2.94,2.94) [0.00,10.00] Total: 292 W: 178 L: 82 D: 32 --- diff --git a/src/evaluate.cpp b/src/evaluate.cpp index f311b14..58a7c27 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -300,6 +300,18 @@ namespace { : Pt == ROOK ? attacks_bb< ROOK>(s, pos.pieces() ^ pos.pieces(QUEEN) ^ pos.pieces(Us, ROOK)) : pos.attacks_from(Us, Pt, s); + // Janggi palace moves + if (pos.diagonal_lines() & s) + { + PieceType diagType = Pt == WAZIR ? FERS : Pt == SOLDIER ? PAWN : Pt == ROOK ? BISHOP : NO_PIECE_TYPE; + if (diagType) + b |= attacks_bb(Us, diagType, s, pos.pieces()) & pos.board_bb(Us, Pt) & pos.diagonal_lines(); + else if (Pt == JANGGI_CANNON) + // TODO: fix for longer diagonals + b |= attacks_bb(Us, ALFIL, s, pos.pieces()) & ~attacks_bb(Us, ELEPHANT, s, pos.pieces() ^ pos.pieces(JANGGI_CANNON)) + & pos.board_bb(Us, Pt) & pos.diagonal_lines(); + } + // Restrict mobility to actual squares of board b &= pos.board_bb();