mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 03:57:45 +00:00
Remove useless code in Position::pretty()
First, remove some dead code (function never called with a Move argument). Then, remove printing of legal moves, which does not belong here. Let's keep commands orthogonal and minimal: - the "d" command should display the board, nothing more, or less. - "perft 1" will display the list of legal moves. No functional change.
This commit is contained in:
+2
-12
@@ -25,7 +25,6 @@
|
||||
|
||||
#include "bitcount.h"
|
||||
#include "movegen.h"
|
||||
#include "notation.h"
|
||||
#include "position.h"
|
||||
#include "psqtab.h"
|
||||
#include "rkiss.h"
|
||||
@@ -430,17 +429,12 @@ const string Position::fen() const {
|
||||
}
|
||||
|
||||
|
||||
/// Position::pretty() returns an ASCII representation of the position to be
|
||||
/// printed to the standard output together with the move's san notation.
|
||||
/// Position::pretty() returns an ASCII representation of the position
|
||||
|
||||
const string Position::pretty(Move m) const {
|
||||
const string Position::pretty() const {
|
||||
|
||||
std::ostringstream ss;
|
||||
|
||||
if (m)
|
||||
ss << "\nMove: " << (sideToMove == BLACK ? ".." : "")
|
||||
<< move_to_san(*const_cast<Position*>(this), m);
|
||||
|
||||
ss << "\n +---+---+---+---+---+---+---+---+\n";
|
||||
|
||||
for (Rank r = RANK_8; r >= RANK_1; --r)
|
||||
@@ -457,10 +451,6 @@ const string Position::pretty(Move m) const {
|
||||
for (Bitboard b = checkers(); b; )
|
||||
ss << to_string(pop_lsb(&b)) << " ";
|
||||
|
||||
ss << "\nLegal moves: ";
|
||||
for (MoveList<LEGAL> it(*this); *it; ++it)
|
||||
ss << move_to_san(*const_cast<Position*>(this), *it) << " ";
|
||||
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user