summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
034a2b0)
To align to same named Position function and
avoid using std::cout directly.
Also remove some stale <iostream> include while
there.
No functional change.
#include <algorithm>
#include <cstring>
#include <algorithm>
#include <cstring>
#include "bitboard.h"
#include "bitcount.h"
#include "bitboard.h"
#include "bitcount.h"
#include "rkiss.h"
CACHE_LINE_ALIGNMENT
#include "rkiss.h"
CACHE_LINE_ALIGNMENT
#endif // ifndef USE_BSFQ
#endif // ifndef USE_BSFQ
-/// Bitboards::print() prints a bitboard in an easily readable format to the
-/// standard output. This is sometimes useful for debugging.
+/// Bitboards::pretty() returns an ASCII representation of a bitboard to be
+/// printed to standard output. This is sometimes useful for debugging.
-void Bitboards::print(Bitboard b) {
+const std::string Bitboards::pretty(Bitboard b) {
for (Rank rank = RANK_8; rank >= RANK_1; --rank)
{
for (Rank rank = RANK_8; rank >= RANK_1; --rank)
{
- std::cout << "+---+---+---+---+---+---+---+---+" << '\n';
+ ss << "+---+---+---+---+---+---+---+---+" << '\n';
for (File file = FILE_A; file <= FILE_H; ++file)
for (File file = FILE_A; file <= FILE_H; ++file)
- std::cout << "| " << (b & (file | rank) ? "X " : " ");
+ ss << "| " << (b & (file | rank) ? "X " : " ");
- std::cout << "+---+---+---+---+---+---+---+---+" << sync_endl;
+ ss << "+---+---+---+---+---+---+---+---+";
+ return ss.str();
namespace Bitboards {
void init();
namespace Bitboards {
void init();
+const std::string pretty(Bitboard b);
#include <algorithm>
#include <cassert>
#include <algorithm>
#include <cassert>
#include "book.h"
#include "misc.h"
#include "book.h"
#include "misc.h"
#include <cassert>
#include <cstring>
#include <iomanip>
#include <cassert>
#include <cstring>
#include <iomanip>
#include <sstream>
#include "bitcount.h"
#include <sstream>
#include "bitcount.h"
#include "tt.h"
using std::string;
#include "tt.h"
using std::string;
-using std::cout;
-using std::endl;
static const string PieceToChar(" PNBRQK pnbrqk");
static const string PieceToChar(" PNBRQK pnbrqk");