Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int eval_surrounders(const libataxx::Position & pos_in)
- {
- int score = 0;
- for(const auto & sq : pos_in.us()) {
- const auto destinations_s = libataxx::Bitboard{sq}.singles() & pos_in.us();
- score += destinations_s.count() == 8;
- const auto destinations_d = libataxx::Bitboard{sq}.doubles() & pos_in.us();
- score += (destinations_d.count() == 16) * 2;
- }
- for(const auto & sq : pos_in.them()) {
- const auto destinations_s = libataxx::Bitboard{sq}.singles() & pos_in.them();
- score -= destinations_s.count() == 8;
- const auto destinations_d = libataxx::Bitboard{sq}.doubles() & pos_in.them();
- score -= (destinations_d.count() == 16) * 2;
- }
- return score;
- }
Advertisement
Add Comment
Please, Sign In to add comment