Advertisement
Guest User

Untitled

a guest
Dec 8th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. bool is_insufficient_material_draw(const libchess::Position & pos)
  2. {
  3. if (pos.piece_type_bb(libchess::constants::PAWN, libchess::constants::WHITE).popcount() ||
  4. pos.piece_type_bb(libchess::constants::PAWN, libchess::constants::WHITE).popcount() ||
  5. pos.piece_type_bb(libchess::constants::ROOK, libchess::constants::WHITE).popcount() ||
  6. pos.piece_type_bb(libchess::constants::ROOK, libchess::constants::WHITE).popcount() ||
  7. pos.piece_type_bb(libchess::constants::QUEEN, libchess::constants::WHITE).popcount() ||
  8. pos.piece_type_bb(libchess::constants::QUEEN, libchess::constants::WHITE).popcount())
  9. return false;
  10.  
  11. if (pos.piece_type_bb(libchess::constants::KNIGHT, libchess::constants::WHITE).popcount() ||
  12. pos.piece_type_bb(libchess::constants::KNIGHT, libchess::constants::WHITE).popcount() ||
  13. pos.piece_type_bb(libchess::constants::BISHOP, libchess::constants::WHITE).popcount() ||
  14. pos.piece_type_bb(libchess::constants::BISHOP, libchess::constants::WHITE).popcount())
  15. return false;
  16.  
  17. return true;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement