Skip to content

Commit 742380c

Browse files
committed
Enhance board output
Closes #983.
1 parent 441e2dd commit 742380c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/position.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,16 @@ std::ostream& operator<<(std::ostream& os, const Position& pos) {
6565
os << " | *";
6666
else if (pos.unpromoted_piece_on(make_square(f, r)))
6767
os << " |+" << pos.piece_to_char()[pos.unpromoted_piece_on(make_square(f, r))];
68+
else if (((pos.captures_to_hand() && !pos.drop_loop()) || pos.two_boards()) && pos.is_promoted(make_square(f, r)))
69+
os << " |~" << pos.piece_to_char()[pos.piece_on(make_square(f, r))];
6870
else
6971
os << " | " << pos.piece_to_char()[pos.piece_on(make_square(f, r))];
7072

73+
#ifdef LARGEBOARDS
74+
os << " |" << (pos.max_rank() == RANK_10 && CurrentProtocol != UCI_GENERAL ? r : 1 + r);
75+
#else
7176
os << " |" << (1 + r);
77+
#endif
7278
if (r == pos.max_rank() || r == RANK_1)
7379
{
7480
Color c = r == RANK_1 ? WHITE : BLACK;

0 commit comments

Comments
 (0)