X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitboard.cpp;h=3683b363c1d90c6c961a09525b2d63a2e2c6fda7;hp=cbece63c43d6bd7ac3938ac8bb3c986323fc99cb;hb=a518d5d3adf0709471be906fd03ee4744477a214;hpb=a71209868bdd8361d0607acf7725f70e9d1f2019 diff --git a/src/bitboard.cpp b/src/bitboard.cpp index cbece63c..3683b363 100644 --- a/src/bitboard.cpp +++ b/src/bitboard.cpp @@ -45,6 +45,7 @@ Bitboard AdjacentFilesBB[FILE_NB]; Bitboard InFrontBB[COLOR_NB][RANK_NB]; Bitboard StepAttacksBB[PIECE_NB][SQUARE_NB]; Bitboard BetweenBB[SQUARE_NB][SQUARE_NB]; +Bitboard LineBB[SQUARE_NB][SQUARE_NB]; Bitboard DistanceRingsBB[SQUARE_NB][8]; Bitboard ForwardBB[COLOR_NB][SQUARE_NB]; Bitboard PassedPawnMask[COLOR_NB][SQUARE_NB]; @@ -197,7 +198,7 @@ void Bitboards::init() { for (Color c = WHITE; c <= BLACK; ++c) for (PieceType pt = PAWN; pt <= KING; ++pt) for (Square s = SQ_A1; s <= SQ_H8; ++s) - for (int k = 0; steps[pt][k]; k++) + for (int k = 0; steps[pt][k]; ++k) { Square to = s + Square(c == WHITE ? steps[pt][k] : -steps[pt][k]); @@ -225,6 +226,9 @@ void Bitboards::init() { for (Square s = s1 + delta; s != s2; s += delta) BetweenBB[s1][s2] |= s; + + PieceType pt = (PseudoAttacks[BISHOP][s1] & s2) ? BISHOP : ROOK; + LineBB[s1][s2] = (PseudoAttacks[pt][s1] & PseudoAttacks[pt][s2]) | s1 | s2; } }