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. <[email protected]>
Imagine a large red swirl here.
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++;