added getQueenAttack function
This commit is contained in:
1 parent
bd6690d168
commit
3bc75f843f
2 files changed
+16
No files matched your search
@@ -257,3 +257,18 @@ Bitboard getRookAttack(int square, U64 occupancy) {
|
|||||||
|
|
||||||
return rookAttacks[square][occupancy];
|
return rookAttacks[square][occupancy];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bitboard getQueenAttack(int square, U64 occupancy) {
|
||||||
|
U64 bishopOccupancy = occupancy;
|
||||||
|
U64 rookOccupancy = occupancy;
|
||||||
|
|
||||||
|
bishopOccupancy &= bishopMasks[square].GetBoard();
|
||||||
|
bishopOccupancy *= bishopMagicNumbers[square];
|
||||||
|
bishopOccupancy >>= (64 - bishopRelevantBits[square]);
|
||||||
|
|
||||||
|
rookOccupancy &= rookMasks[square].GetBoard();
|
||||||
|
rookOccupancy *= rookMagicNumbers[square];
|
||||||
|
rookOccupancy >>= (64 - rookRelevantBits[square]);
|
||||||
|
|
||||||
|
return rookAttacks[square][rookOccupancy] | bishopAttacks[square][bishopOccupancy];
|
||||||
|
}
|
||||||
@@ -213,3 +213,4 @@ void initSliderAttacks();
|
|||||||
|
|
||||||
Bitboard getBishopAttack(int square, U64 occupancy);
|
Bitboard getBishopAttack(int square, U64 occupancy);
|
||||||
Bitboard getRookAttack(int square, U64 occupancy);
|
Bitboard getRookAttack(int square, U64 occupancy);
|
||||||
|
Bitboard getQueenAttack(int square, U64 occupancy);
|
||||||
Reference in new issue
Block a user