]> git.sesse.net Git - stockfish/commitdiff
show coordinates when displaying board
authorNguyenPham <phhnguyen@gmail.com>
Sun, 7 Jun 2020 21:48:38 +0000 (07:48 +1000)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Tue, 9 Jun 2020 16:28:20 +0000 (18:28 +0200)
closes https://github.com/official-stockfish/Stockfish/pull/2723

No functional change

AUTHORS
src/bitboard.cpp
src/position.cpp

diff --git a/AUTHORS b/AUTHORS
index 36c2a47b8ada1231d54500956453dc7aa79a00dd..1cd7ff54b0f6c9ea380dd3c7bf3d2eedf2a3ce71 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -115,6 +115,7 @@ Nick Pelling (nickpelling)
 Nicklas Persson (NicklasPersson)
 Niklas Fiekas (niklasf)
 Nikolay Kostov (NikolayIT)
+Nguyen Pham
 Ondrej Mosnáček (WOnder93)
 Oskar Werkelin Ahlin
 Pablo Vazquez
index f650eef68627671dee2b3892e60f6d75b8cbff5b..3bb3ff8f8d5777ab0aa9ccf9e3928d3e94280051 100644 (file)
@@ -56,8 +56,9 @@ const std::string Bitboards::pretty(Bitboard b) {
       for (File f = FILE_A; f <= FILE_H; ++f)
           s += b & make_square(f, r) ? "| X " : "|   ";
 
-      s += "|\n+---+---+---+---+---+---+---+---+\n";
+      s += "| " + std::to_string(1 + r) + "\n+---+---+---+---+---+---+---+---+\n";
   }
+  s += "  a   b   c   d   e   f   g   h\n";
 
   return s;
 }
index d2e33b3022bf0b1cc1cbe0554f2f2b8627d379ba..c9db6224abfa2a160d5cf0777c15993a34e86f4b 100644 (file)
@@ -64,10 +64,11 @@ std::ostream& operator<<(std::ostream& os, const Position& pos) {
       for (File f = FILE_A; f <= FILE_H; ++f)
           os << " | " << PieceToChar[pos.piece_on(make_square(f, r))];
 
-      os << " |\n +---+---+---+---+---+---+---+---+\n";
+      os << " | " << (1 + r) << "\n +---+---+---+---+---+---+---+---+\n";
   }
 
-  os << "\nFen: " << pos.fen() << "\nKey: " << std::hex << std::uppercase
+  os << "   a   b   c   d   e   f   g   h\n"
+     << "\nFen: " << pos.fen() << "\nKey: " << std::hex << std::uppercase
      << std::setfill('0') << std::setw(16) << pos.key()
      << std::setfill(' ') << std::dec << "\nCheckers: ";