From: H.G. Muller Date: Fri, 19 Nov 2010 17:23:05 +0000 (+0100) Subject: Define moves for Dragon Horse outside Shogi X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=811dfee19c2a85cb60d9506ff3f9a82d00135608;p=xboard.git Define moves for Dragon Horse outside Shogi Let it move like Bishop + Wazir + Dababba. --- diff --git a/moves.c b/moves.c index 331840e..4df7d42 100644 --- a/moves.c +++ b/moves.c @@ -428,6 +428,18 @@ void GenPseudoLegal(board, flags, callback, closure) } break; + /* Make Dragon-Horse also do Dababba moves outside Shogi, for better disambiguation in variant Fairy */ + case WhiteCardinal: + case BlackCardinal: + for (d = 0; d <= 1; d++) // Dababba moves that Rook cannot do + for (s = -2; s <= 2; s += 4) { + rt = rf + s * d; + ft = ff + s * (1 - d); + if (rt < 0 || rt >= BOARD_HEIGHT || ft < BOARD_LEFT || ft >= BOARD_RGHT) continue; + if (SameColor(board[rf][ff], board[rt][ft])) continue; + callback(board, flags, NormalMove, rf, ff, rt, ft, closure); + } + /* Shogi Dragon Horse has to continue with Wazir after Bishop */ case SHOGI WhiteCardinal: case SHOGI BlackCardinal: