From 811dfee19c2a85cb60d9506ff3f9a82d00135608 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Fri, 19 Nov 2010 18:23:05 +0100 Subject: [PATCH] Define moves for Dragon Horse outside Shogi Let it move like Bishop + Wazir + Dababba. --- moves.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) 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: -- 1.7.0.4