nkarve / surge

A fast bitboard-based chess move generator in C++
MIT License
63 stars 15 forks source link

Populated the value of piece_bb[NO_PIECE] #14

Open osvitashev opened 3 years ago

osvitashev commented 3 years ago

The idea was to make piece_bb[NO_PIECE] usable. It is not required for move generation, as it can always be derived form other bit boards. However, I have found not having this value readily accessible to be unintuitive.

It is initialized to all '1's in default Position constructor; The value is updated in put_piece, remove_piece, move_piece and move_piece_quiet methods Updated generate_legals and ran perft to validate correct behavior.

Hopefully i have not missed anything