Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
yjf2002ghty committed May 5, 2024
1 parent 30583b0 commit ede38d8
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/bitboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -461,12 +461,12 @@ inline Bitboard attacks_bb(Square s, Bitboard occupied) {
}
}

/// find_rider() finds a rider in a (hybrid) rider type
/// pop_rider() finds and clears a rider in a (hybrid) rider type

inline RiderType find_rider(RiderType& r) {
inline RiderType pop_rider(RiderType& r) {
assert(r);
const RiderType r2 = r & ~(r - 1);
//r &= r - 1;
r &= r - 1;
return r2;
}

Expand All @@ -475,10 +475,7 @@ inline Bitboard attacks_bb(Color c, PieceType pt, Square s, Bitboard occupied) {
Bitboard b = LeaperAttacks[c][pt][s];
RiderType r = AttackRiderTypes[pt];
while (r)
{
b |= rider_attacks_bb(find_rider(r), s, occupied);
r &= r - 1;
}
b |= rider_attacks_bb(pop_rider(r), s, occupied);
return b & PseudoAttacks[c][pt][s];
}

Expand All @@ -489,10 +486,7 @@ inline Bitboard moves_bb(Color c, PieceType pt, Square s, Bitboard occupied) {
Bitboard b = LeaperMoves[Initial][c][pt][s];
RiderType r = MoveRiderTypes[Initial][pt];
while (r)
{
b |= rider_attacks_bb(find_rider(r), s, occupied);
r &= r - 1;
}
b |= rider_attacks_bb(pop_rider(r), s, occupied);
return b & PseudoMoves[Initial][c][pt][s];
}

Expand Down

0 comments on commit ede38d8

Please # to comment.