42 if (nDepth &&
getLevel()->searchDepthReached(nDepth)) {
78 for (
movenum_t moveid = 1; moveid <= n_moves; ++moveid) {
137 return terminalScore;
152 return terminalScore;
155 if (
getLevel()->qsDepthReached(nDepth)) {
160 return terminalScore;
166 bool escapeFirstCheck =
false;
168 if ((nCheckCount < 1) && (b.
isInCheck())) {
170 escapeFirstCheck =
true;
176 return terminalScore;
196 depth_t nNewDepth = nDepth + 1;
200 for (
movenum_t moveid = 1; moveid <= n_moves; ++moveid) {
union boardInfo boardInfo_t
This is the main include file, needs to be included before any other include.
bScore CalcBestMove(bBoard &b, bMoveList &ml) override
Root search for algorithm.
bScore m_nBetaCutOffMargin
bScore Quiescence(bBoard &b, depth_t const nDepth, bSearchScore alpha, bSearchScore beta, uint8_t nCheckCount)
Calculate best move from this position considering only non-silent moves.
constexpr bScore minimizing() const
void unApplyMove(bMove const &m, boardInfo_t const oldBoardInfo)
exact restoration of basic board using move details
constexpr bool isInCheck() const
constexpr bool isNonSilent() const
void setVariation(bBoard const &chldbrd)
boardInfo_t applyMove(bMove const &m) override
modification of board move is kept on previous board newboard does not have move stored and has flag ...
void calcMinorPieces(bool const bForceRecalc=false)
Recalculate minor pieces, used for evaluation and end of game condition in case of less than 5 pieces...
movenum_t generateMoves(bBasicBoard const &b)
generate moves if not yet generated
void setBestMoveScore(movenum_t const moveid, bScore const score)
void sortMoves()
sort moves and update bestmove id if less than 5 moves, sort all if more than 5 moves,...
bool setScoreOfMove(movenum_t const moveid, bScore const score)
Store score of move and update best move.
constexpr movenum_t getNumberOfQSMoves() const
static bScore resultToScoreFlag(gameResult_t const gr)
Class static function convert all draw scores to SCORE_THEORETIC_DRAW.
static gameResult_t gameEndedResult(bBoard const &b)
Class static function See if board is in finite state, meaning game is ended.
static bool isDrawResult(gameResult_t const gr)
void adjustMaxSearchedDepth(depth_t const nDepth)
void sendInfoCurrMove(bBoard const &b, depth_t const nCurDepth, bMove const &m, movenum_t const moveid) const
constexpr bool isNoBench() const
bScore RetrieveBoardEvaluation(bBoard &b, gameResult_t const gr=GR_UNSET) const
Get score of board, eventually from cache.
void CheckIfAbortingSearch() const
constexpr bScore getScore() const
bool improvesOn(bSearchScore const &sc)
constexpr bool isWinning() const
enum gameResult gameResult_t
constexpr bScore SCORE_INFINITE
std::string to_string(int16_t value)
std::to_string not compatible on Mac OS (Apple LLVM version 5.0) provide generic utility function
#define DEBUG_sendInfoSearchingNS(b, depth, msg)
#define DEBUG_sendInfoSearching(b, depth, msg, sc)