From 143108ec618a4ce3a6dbb1b17b05cd715eb11dea Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Sun, 5 Aug 2007 18:52:20 +0200 Subject: [PATCH] Add shogi-related traces in various places. Commented-out trace #1 triggers in gnushogi-gnushogi game. What can make tagua look at such invalid moves ? Trace #2 is to give a diagnostic if we ever get something else than a drop when we are expecting one. --- src/hlvariant/shogi/legalitycheck.h | 4 +++- src/hlvariant/shogi/serializer.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hlvariant/shogi/legalitycheck.h b/src/hlvariant/shogi/legalitycheck.h index 5fdc630..34fc699 100644 --- a/src/hlvariant/shogi/legalitycheck.h +++ b/src/hlvariant/shogi/legalitycheck.h @@ -160,8 +160,10 @@ bool LegalityCheck::pseudolegal(Move& move) const { move.setType(Move::PROMOTION); return true; } - else + else { + //std::cerr << "CANNOT MOVE: piece type cannot go there" << std::endl; return false; + } } } diff --git a/src/hlvariant/shogi/serializer.h b/src/hlvariant/shogi/serializer.h index a01370c..13e6782 100644 --- a/src/hlvariant/shogi/serializer.h +++ b/src/hlvariant/shogi/serializer.h @@ -208,8 +208,10 @@ Serializer::deserialize(const QString& str, const GameState& ref) return Move(orig, dest, (str.size() > 4) && (str[4] == '+')); } else { - if (str[1] != '*') + if (str[1] != '*') { + std::cerr << "Expected a star, got a '" << str[1].toAscii() << "'" << std::endl; return Move(); + } typename Piece::Type t = getType(str[0]); Point to(ref.board().size().x - str[2].digitValue(), str[3].toAscii() - 'a'); return Move(Piece(ref.turn(), t), to); -- 2.11.4.GIT