[MoveGenerator] Add generateAttackedSquares, fix castling

This commit is contained in:
2022-12-22 23:52:53 +01:00
parent 151da7eb51
commit 0d7f030634
5 changed files with 45 additions and 31 deletions

View File

@@ -11,7 +11,7 @@ TEST_CASE("King attacks are correctly generated", "[Board][Fundamental]") {
auto board = BitBoard::fromIndex(G2);
board |= BitBoard::fromIndex(B7);
BitBoard ka = BitBoard::kingAttacks(board);
BitBoard ka = BitBoard::kingMoves(board);
REQUIRE((ka == (
BitBoard::fromIndex(G1) | BitBoard::fromIndex(G3) | BitBoard::fromIndex(H1) | BitBoard::fromIndex(H2)
| BitBoard::fromIndex(H3) | BitBoard::fromIndex(F1) | BitBoard::fromIndex(F2)