]> git.sesse.net Git - stockfish/commitdiff
Remove useless code in Position::pretty()
authorlucasart <lucas.braesch@gmail.com>
Tue, 5 Aug 2014 23:04:27 +0000 (07:04 +0800)
committerlucasart <lucas.braesch@gmail.com>
Tue, 5 Aug 2014 23:04:27 +0000 (07:04 +0800)
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.

src/position.cpp
src/position.h

index bdbfea8017583fe3b8ca432738bc54a6dec886af..23370ca3f73d4ed8fedbd14595c8b30af2b332b7 100644 (file)
@@ -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();
 }
 
index d950411f6fe63cfac676e83d9e748f11f4c925fd..8f5fb75aa7f4630d07e203764277057cc3a8d8f6 100644 (file)
@@ -83,7 +83,7 @@ public:
   // Text input/output
   void set(const std::string& fenStr, bool isChess960, Thread* th);
   const std::string fen() const;
-  const std::string pretty(Move m = MOVE_NONE) const;
+  const std::string pretty() const;
 
   // Position representation
   Bitboard pieces() const;