mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 00:56:39 +08:00
Fix regression: print const position
Fix a regression introduced with new TB code. No functional change.
This commit is contained in:
@@ -86,7 +86,7 @@ PieceType min_attacker<KING>(const Bitboard*, Square, Bitboard, Bitboard&, Bitbo
|
||||
|
||||
/// operator<<(Position) returns an ASCII representation of the position
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, Position& pos) {
|
||||
std::ostream& operator<<(std::ostream& os, const Position& pos) {
|
||||
|
||||
os << "\n +---+---+---+---+---+---+---+---+\n";
|
||||
|
||||
@@ -108,9 +108,12 @@ std::ostream& operator<<(std::ostream& os, Position& pos) {
|
||||
if ( int(Tablebases::MaxCardinality) >= popcount(pos.pieces())
|
||||
&& !pos.can_castle(ANY_CASTLING))
|
||||
{
|
||||
StateInfo st;
|
||||
Position p;
|
||||
p.set(pos.fen(), pos.is_chess960(), &st, pos.this_thread());
|
||||
Tablebases::ProbeState s1, s2;
|
||||
Tablebases::WDLScore wdl = Tablebases::probe_wdl(pos, &s1);
|
||||
int dtz = Tablebases::probe_dtz(pos, &s2);
|
||||
Tablebases::WDLScore wdl = Tablebases::probe_wdl(p, &s1);
|
||||
int dtz = Tablebases::probe_dtz(p, &s2);
|
||||
os << "\nTablebases WDL: " << std::setw(4) << wdl << " (" << s1 << ")"
|
||||
<< "\nTablebases DTZ: " << std::setw(4) << dtz << " (" << s2 << ")";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user