From 0a2736f60d192c99c6c71990ec3732065fb67159 Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Sat, 3 Nov 2018 10:40:19 +0100 Subject: [PATCH] Implement SEE for piece drops crazyhouse STC LLR: 2.96 (-2.94,2.94) [-10.00,5.00] Total: 199 W: 129 L: 64 D: 6 http://35.161.250.236:6543/tests/view/5bdd6d426e23db7639060c61 shogi ELO: 15.65 +-33.1 (95%) LOS: 82.4% Total: 400 W: 197 L: 179 D: 24 euroshogi ELO: 78.62 +-34.4 (95%) LOS: 100.0% Total: 400 W: 238 L: 149 D: 13 minishogi ELO: 36.62 +-32.7 (95%) LOS: 98.7% Total: 400 W: 203 L: 161 D: 36 --- src/position.cpp | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/position.cpp b/src/position.cpp index 2f90e1b..7c992f7 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1342,13 +1342,13 @@ bool Position::see_ge(Move m, Value threshold) const { assert(is_ok(m)); // Only deal with normal moves, assume others pass a simple see - if (type_of(m) != NORMAL) + if (type_of(m) != NORMAL && type_of(m) != DROP) return VALUE_ZERO >= threshold; Bitboard stmAttackers; Square from = from_sq(m), to = to_sq(m); - PieceType nextVictim = type_of(piece_on(from)); - Color us = color_of(piece_on(from)); + PieceType nextVictim = type_of(m) == DROP ? dropped_piece_type(m) : type_of(piece_on(from)); + Color us = type_of(m) == DROP ? sideToMove : color_of(piece_on(from)); Color stm = ~us; // First consider opponent's move Value balance; // Values of the pieces taken by us minus opponent's ones @@ -1385,7 +1385,7 @@ bool Position::see_ge(Move m, Value threshold) const { // Find all attackers to the destination square, with the moving piece // removed, but possibly an X-ray attacker added behind it. - Bitboard occupied = pieces() ^ from ^ to; + Bitboard occupied = type_of(m) == DROP ? pieces() ^ to : pieces() ^ from ^ to; Bitboard attackers = attackers_to(to, occupied) & occupied; while (true) -- 1.7.0.4