-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmovegenerator.cpp
More file actions
executable file
·24 lines (21 loc) · 761 Bytes
/
movegenerator.cpp
File metadata and controls
executable file
·24 lines (21 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "movegenerator.h"
#include "queen.h"
namespace Napoleon
{
void MoveGenerator::GetQueenMoves(BitBoard queens, Board &board, Move moveList[], int &pos, BitBoard target)
{
BitBoard targets;
Square fromIndex;
Square toIndex;
while (queens != 0)
{
fromIndex = Utils::BitBoard::BitScanForwardReset(queens); // search for LS1B and then reset it
targets = Queen::GetAllTargets(Constants::Masks::SquareMask[fromIndex], board) & target;
while (targets != 0)
{
toIndex = Utils::BitBoard::BitScanForwardReset(targets); // search for LS1B and then reset it
moveList[pos++] = Move(fromIndex, toIndex);
}
}
}
}