X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=inline;f=src%2Fbitboard.cpp;h=2afd3766babf552bfecf9639ae99e3991bc59dbf;hb=e0f42aa956e731b5faae0585f5cc47da23fbe53c;hp=2adf27794209a4e89d175eca412453a2beda2f48;hpb=82ad9ce9cfb0eff33f1d781f329f7c5dc0b277eb;p=stockfish
diff --git a/src/bitboard.cpp b/src/bitboard.cpp
index 2adf2779..2afd3766 100644
--- a/src/bitboard.cpp
+++ b/src/bitboard.cpp
@@ -18,8 +18,8 @@
along with this program. If not, see .
*/
-#include
#include
+#include
#include "bitboard.h"
#include "misc.h"
@@ -27,18 +27,10 @@
uint8_t PopCnt16[1 << 16];
uint8_t SquareDistance[SQUARE_NB][SQUARE_NB];
-Bitboard BetweenBB[SQUARE_NB][SQUARE_NB];
+Bitboard SquareBB[SQUARE_NB];
Bitboard LineBB[SQUARE_NB][SQUARE_NB];
-Bitboard DistanceRingBB[SQUARE_NB][8];
Bitboard PseudoAttacks[PIECE_TYPE_NB][SQUARE_NB];
Bitboard PawnAttacks[COLOR_NB][SQUARE_NB];
-Bitboard SquareBB[SQUARE_NB];
-
-Bitboard KingFlank[FILE_NB] = {
- QueenSide ^ FileDBB, QueenSide, QueenSide,
- CenterFiles, CenterFiles,
- KingSide, KingSide, KingSide ^ FileEBB
-};
Magic RookMagics[SQUARE_NB];
Magic BishopMagics[SQUARE_NB];
@@ -84,14 +76,11 @@ void Bitboards::init() {
for (Square s1 = SQ_A1; s1 <= SQ_H8; ++s1)
for (Square s2 = SQ_A1; s2 <= SQ_H8; ++s2)
- {
SquareDistance[s1][s2] = std::max(distance(s1, s2), distance(s1, s2));
- DistanceRingBB[s1][SquareDistance[s1][s2]] |= s2;
- }
int steps[][5] = { {}, { 7, 9 }, { 6, 10, 15, 17 }, {}, {}, {}, { 1, 7, 8, 9 } };
- for (Color c = WHITE; c <= BLACK; ++c)
+ for (Color c : { WHITE, BLACK })
for (PieceType pt : { PAWN, KNIGHT, KING })
for (Square s = SQ_A1; s <= SQ_H8; ++s)
for (int i = 0; steps[pt][i]; ++i)
@@ -121,10 +110,7 @@ void Bitboards::init() {
for (PieceType pt : { BISHOP, ROOK })
for (Square s2 = SQ_A1; s2 <= SQ_H8; ++s2)
if (PseudoAttacks[pt][s1] & s2)
- {
LineBB[s1][s2] = (attacks_bb(pt, s1, 0) & attacks_bb(pt, s2, 0)) | s1 | s2;
- BetweenBB[s1][s2] = attacks_bb(pt, s1, square_bb(s2)) & attacks_bb(pt, s2, square_bb(s1));
- }
}
}