using std::string;
using std::cout;
using std::endl;
+using Eval::evaluate;
using namespace Search;
namespace {
Position& pos = RootPosition;
Chess960 = pos.is_chess960();
+ Eval::RootColor = pos.side_to_move();
SearchTime.restart();
TimeMgr.init(Limits, pos.startpos_ply_counter());
TT.new_search();
}
}
- // Read UCI options: GUI could change UCI parameters during the game
- read_evaluation_uci_options(pos.side_to_move());
- Threads.read_uci_options();
-
- TT.set_size(Options["Hash"]);
- if (Options["Clear Hash"])
- {
- Options["Clear Hash"] = false;
- TT.clear();
- }
-
UCIMultiPV = Options["MultiPV"];
SkillLevel = Options["Skill Level"];
kingAtt = pos.attacks_from<KING>(ksq);
pc = pos.piece_moved(move);
- occ = pos.occupied_squares() & ~(1ULL << from) & ~(1ULL << ksq);
+ occ = pos.pieces() ^ from ^ ksq;
oldAtt = pos.attacks_from(pc, from, occ);
newAtt = pos.attacks_from(pc, to, occ);
// Rule 1. Checks which give opponent's king at most one escape square are dangerous
b = kingAtt & ~pos.pieces(them) & ~newAtt & ~(1ULL << to);
- if (!(b && (b & (b - 1))))
+ if (single_bit(b)) // Catches also !b
return true;
// Rule 2. Queen contact check is very dangerous
ksq = pos.king_square(pos.side_to_move());
if ( piece_is_slider(p1)
&& (squares_between(t1, ksq) & f2)
- && (pos.attacks_from(p1, t1, pos.occupied_squares() ^ f2) & ksq))
+ && (pos.attacks_from(p1, t1, pos.pieces() ^ f2) & ksq))
return true;
return false;