X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitboard.cpp;h=bfacc4121a0312b2d2461239008344c940c3857f;hp=b7eed922d10b0badeb0c4580ea34b76e31adaabf;hb=ce6b7a1b859ab1b416e6df5bddfc942c9c2f9ae7;hpb=e6523e56b8cc110aa38d698a993cb04b430e67b0 diff --git a/src/bitboard.cpp b/src/bitboard.cpp index b7eed922..bfacc412 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) + for (Rank r = RANK_8; r >= RANK_1; --r) { - ss << "+---+---+---+---+---+---+---+---+" << '\n'; + for (File f = FILE_A; f <= FILE_H; ++f) + s.append(b & make_square(f, r) ? "| X " : "| "); - for (File file = FILE_A; file <= FILE_H; ++file) - ss << "| " << (b & (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;