43 if (nDepth &&
getLevel()->searchDepthReached(nDepth)) {
155 return terminalScore;
158 if (
getLevel()->qsDepthReached(nDepth)) {
161 return terminalScore;
167 bool escapeFirstCheck =
false;
169 if ((nCheckCount < 1) && (b.
isInCheck())) {
171 escapeFirstCheck =
true;
175 return terminalScore;
185 return terminalScore;
191 alpha = terminalScore;
194 depth_t nNewDepth = nDepth + 1;
229 return terminalScore;
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
constexpr bool isCheck() 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 ...
movenum_t generateMoves(bBasicBoard const &b)
generate moves if not yet generated
bool setScoreOfMove(movenum_t const moveid, bScore const score)
Store score of move and update best move.
constexpr movenum_t getNumberOfQSMoves() const
void setBestMoveScore(bScore const score)
void sortMoves(bool const bFastSort)
sort moves and update bestmove id if less than 5 moves, sort all if more than 5 moves,...
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, bool const bRecalcFirst) 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_UNDEFINED
constexpr bScore SCORE_THEORETIC_DRAW
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)