mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Fix regression: print const position
Fix a regression introduced with new TB code. No functional change.
This commit is contained in:
parent
e7289465b9
commit
ec83e8a72c
2 changed files with 7 additions and 4 deletions
|
@ -86,7 +86,7 @@ PieceType min_attacker<KING>(const Bitboard*, Square, Bitboard, Bitboard&, Bitbo
|
||||||
|
|
||||||
/// operator<<(Position) returns an ASCII representation of the position
|
/// 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";
|
os << "\n +---+---+---+---+---+---+---+---+\n";
|
||||||
|
|
||||||
|
@ -108,9 +108,12 @@ std::ostream& operator<<(std::ostream& os, Position& pos) {
|
||||||
if ( int(Tablebases::MaxCardinality) >= popcount(pos.pieces())
|
if ( int(Tablebases::MaxCardinality) >= popcount(pos.pieces())
|
||||||
&& !pos.can_castle(ANY_CASTLING))
|
&& !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::ProbeState s1, s2;
|
||||||
Tablebases::WDLScore wdl = Tablebases::probe_wdl(pos, &s1);
|
Tablebases::WDLScore wdl = Tablebases::probe_wdl(p, &s1);
|
||||||
int dtz = Tablebases::probe_dtz(pos, &s2);
|
int dtz = Tablebases::probe_dtz(p, &s2);
|
||||||
os << "\nTablebases WDL: " << std::setw(4) << wdl << " (" << s1 << ")"
|
os << "\nTablebases WDL: " << std::setw(4) << wdl << " (" << s1 << ")"
|
||||||
<< "\nTablebases DTZ: " << std::setw(4) << dtz << " (" << s2 << ")";
|
<< "\nTablebases DTZ: " << std::setw(4) << dtz << " (" << s2 << ")";
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,7 +190,7 @@ private:
|
||||||
bool chess960;
|
bool chess960;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern std::ostream& operator<<(std::ostream& os, Position& pos);
|
extern std::ostream& operator<<(std::ostream& os, const Position& pos);
|
||||||
|
|
||||||
inline Color Position::side_to_move() const {
|
inline Color Position::side_to_move() const {
|
||||||
return sideToMove;
|
return sideToMove;
|
||||||
|
|
Loading…
Add table
Reference in a new issue