https://github.com/B4dT0bi/texel/blob/m ... oveGen.cpp
I think I mostly understand it but there are a couple of things I'm not sure about.
Code: Select all
validTargets |= pos.pieceTypeBB(OtherColor::KING);
It ands the move bitboards for each piece with validTargets so that only the check evasions will be generated. That makes sense.
I don't understand the king move generation though:
Code: Select all
// King moves
{
int sq = pos.getKingSq(wtm);
U64 m = BitBoard::kingAttacks(sq) & ~pos.colorBB(wtm);
addMovesByMask(moveList, sq, m);
}
Thanks.