Bug#920615: patch to output move in PGN compatible format
Bill Allombert
ballombe at debian.org
Sun Jan 27 13:12:53 GMT 2019
Package: brutalchess
Version: 0.5.2+dfsg-7.1
Severity: wishlist
Tags: patch
Dear Debian Games Team,
Please find a patch which change the move list output to stdout to PGN compatible
format (so it can be imported to other software).
There is two changes:
- replace space by -
- handle promotion.
Cheers,
--
Bill. <ballombe at debian.org>
Imagine a large red swirl here.
-------------- next part --------------
Index: brutalchess-0.5.2+dfsg/src/chessgamestate.cpp
===================================================================
--- brutalchess-0.5.2+dfsg.orig/src/chessgamestate.cpp
+++ brutalchess-0.5.2+dfsg/src/chessgamestate.cpp
@@ -141,7 +141,13 @@ void ChessGameState::update(const BoardM
m_threefold_count.push_back(make_pair(sb, 1));
}
- cout << m_turn_number << ". " << bm.origin() << " " << bm.dest() << endl;
+ cout << m_turn_number << ". " << bm.origin() << "-" << bm.dest();
+ if (bm.getPromotion() != Piece::NOTYPE)
+ {
+ static const char* Name = "PRNBQK ";
+ cout << "=" << Name[bm.getPromotion()];
+ }
+ cout << endl;
if(m_white_turn) {
m_turn_number++;
More information about the Pkg-games-devel
mailing list