X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitboard.cpp;h=d4b8bcfdf2cabb53d59e20ff8a055688db6a54a8;hp=b7eed922d10b0badeb0c4580ea34b76e31adaabf;hb=4833887842f3e43153306799ecc8f8a3d181f3b0;hpb=e6523e56b8cc110aa38d698a993cb04b430e67b0 diff --git a/src/bitboard.cpp b/src/bitboard.cpp index b7eed922..d4b8bcfd 100644 --- a/src/bitboard.cpp +++ b/src/bitboard.cpp @@ -18,8 +18,7 @@ */ #include -#include -#include +#include // For memset #include "bitboard.h" #include "bitcount.h" @@ -130,19 +129,17 @@ Square msb(Bitboard b) { const std::string Bitboards::pretty(Bitboard b) { - std::ostringstream ss; + std::string s = "+---+---+---+---+---+---+---+---+\n"; for (Rank rank = RANK_8; rank >= RANK_1; --rank) { - ss << "+---+---+---+---+---+---+---+---+" << '\n'; - for (File file = FILE_A; file <= FILE_H; ++file) - ss << "| " << (b & (file | rank) ? "X " : " "); + s.append(b & make_square(file, rank) ? "| X " : "| "); - ss << "|\n"; + s.append("|\n+---+---+---+---+---+---+---+---+\n"); } - ss << "+---+---+---+---+---+---+---+---+"; - return ss.str(); + + return s; } @@ -255,7 +252,7 @@ namespace { Bitboard masks[], unsigned shifts[], Square deltas[], Fn index) { int MagicBoosters[][8] = { { 969, 1976, 2850, 542, 2069, 2852, 1708, 164 }, - { 3101, 552, 3555, 926, 834, 4122, 2131, 1117 } }; + { 3101, 552, 3555, 926, 834, 26, 2131, 1117 } }; RKISS rk; Bitboard occupancy[4096], reference[4096], edges, b;