本文整理汇总了C++中node_t::board_rooks_black方法的典型用法代码示例。如果您正苦于以下问题:C++ node_t::board_rooks_black方法的具体用法?C++ node_t::board_rooks_black怎么用?C++ node_t::board_rooks_black使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类node_t
的用法示例。
在下文中一共展示了node_t::board_rooks_black方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
bool
tablebase_t::operator()(const node_t& node, const std::uint_fast8_t height, score_t& score) const
{
std::uint32_t rgiCounters[10];
unsigned int rgsqWhite[C_PIECES * 5 + 1];
unsigned int rgsqBlack[C_PIECES * 5 + 1];
// initialize counters and piece arrays so the probe code
// can compute the modified Godel number.
init(rgiCounters, rgsqWhite, 0, node.board_pawns_white());
init(rgiCounters, rgsqWhite, 1, node.board_knights_white());
init(rgiCounters, rgsqWhite, 2, node.board_bishops_white());
init(rgiCounters, rgsqWhite, 3, node.board_rooks_white());
init(rgiCounters, rgsqWhite, 4, node.board_queens_white());
init(rgiCounters + 5, rgsqBlack, 0, node.board_pawns_black());
init(rgiCounters + 5, rgsqBlack, 1, node.board_knights_black());
init(rgiCounters + 5, rgsqBlack, 2, node.board_bishops_black());
init(rgiCounters + 5, rgsqBlack, 3, node.board_rooks_black());
init(rgiCounters + 5, rgsqBlack, 4, node.board_queens_black());
std::lock_guard<std::mutex> lock(const_cast<std::mutex&>(_mutex));
// tablebase registered ?
int iTb = IDescFindFromCounters((int*)rgiCounters);
if (!iTb)
return false;
// set up tablebase parameters
std::uint32_t invert;
int side;
unsigned int* psqW;
unsigned int* psqB;
rgsqWhite[C_PIECES * 5] = node.square_king_white();
rgsqBlack[C_PIECES * 5] = node.square_king_black();
if (iTb > 0)
{
side = node.color() == black;
invert = false;
psqW = rgsqWhite;
psqB = rgsqBlack;
}
else
{
side = node.color() == white;
invert = true;
psqW = rgsqBlack;
psqB = rgsqWhite;
iTb = -iTb;
}
// tablebase registered ?
if (!FRegisteredFun(iTb, side))
return false;
// get tbValue
const unsigned int sqEnP = node.square_en_passant() ? node.square_en_passant() : 127;
const std::uint64_t index = PfnIndCalcFun(iTb, side) ((unsigned int *)psqW, (unsigned int *)psqB, sqEnP, invert);
const score_t tbValue = L_TbtProbeTable(iTb, side, index);
if (tbValue == L_bev_broken)
return false;
// convert tbValue to score
if (tbValue > 0)
score = /*Score::max*/ +30000 + 2 * (-L_bev_mi1 + tbValue - 1) - (score_t)height + 1;
else if (tbValue < 0)
score = /*Score::min*/ -30000 + 2 * (+L_bev_mi1 + tbValue) + (score_t)height;
else
score = 0;//Score::remis;
return true;
}