|
Belofte version 2.2.0
A promising chess program using the UCI or Winboard interface
|
Allow index mapper for char values of piece into int in 1-12 range to reduce space and easy initialisation. More...
Typedefs | |
| typedef std::vector< std::string > | stringList |
Functions | |
| stringList const | stringSplit (std::string src, std::string const &delim) |
| Split delimited long string into a vector. | |
| std::pair< std::string, std::string > | decompose (std::string const &src, std::string const &delim) |
| Split delimited long string into a pair based on delimiter e.g. | |
| std::string | to_string (int16_t value) |
| std::to_string not compatible on Mac OS (Apple LLVM version 5.0) provide generic utility function | |
| std::string | to_string (int32_t value) |
| std::string | to_string (int64_t value) |
| std::string | alltrim (std::string s, std::string const &delim=" ") |
| trim left and right spaces or delim from string | |
| bool | is_number (std::string const &s) |
| int | getRandomInt (int const nCeil) |
| return random in between 0 and nCeil - 1 | |
| int | getRandomRange (int const nStart, int const nMax) |
| std::string | getRCname (std::string const &basename) |
| convert executable name into name.rc, possibly dropping .exe suffix | |
| int | positionParamIndex (stringList const ¶m, std::string const &find) |
| find position in which param has been found | |
| int | positionParamValue (stringList const ¶m, std::string const &find, unsigned long const nOffSet=0) |
| std::string | currentDate () |
| std::string | prettyTime (long const nTime) |
Variables | |
| bWhiteKing const * | cWhiteKingClass = nullptr |
| bBlackKing const * | cBlackKingClass = nullptr |
| static piece_t | bPieceIndex [128] = {} |
| static cpiece_t | bPieceMapper [tPiece::P_SIZE] = {} |
| static bPiece * | pieceinstances [tPiece::P_SIZE] |
| static boardbitmap_t | kingmoves [64] = {} |
| static boardbitmap_t | knightmoves [64] = {} |
| static case_t | kingarray [64][9] = {} |
| static case_t | knightarray [64][9] = {} |
Allow index mapper for char values of piece into int in 1-12 range to reduce space and easy initialisation.
we declare a separate namespace just for code purity below declarations are globals, not static
| typedef std::vector<std::string> belofte::stringList |
| belofte::stringList const belofte::stringSplit | ( | std::string | src, |
| std::string const & | delim ) |
Split delimited long string into a vector.
Definition at line 148 of file util.cpp.
Referenced by bBasicBoard::bBasicBoard(), cmd_bench::execute(), cmd_epd::execute(), cmd_go::execute(), cmd_level::execute(), cmd_option::execute(), cmd_perft::execute(), cmd_setoption::execute(), bEpd::parseSTSPosition(), bGame::playGameMoveSeries(), bGame::playPGNMoves(), engineInterface::sendHelp(), bEpd::setPos(), and bEpd::translateEpdResult().
Here is the call graph for this function:
Here is the caller graph for this function:| std::pair< std::string, std::string > belofte::decompose | ( | std::string const & | src, |
| std::string const & | delim ) |
Split delimited long string into a pair based on delimiter e.g.
parameter1=x y z, "=" => parameter1, x y z 1) the chapter, " " => 1), the chapter
Definition at line 167 of file util.cpp.
Referenced by bEpd::parseSTSPosition(), and bEpd::setPos().
Here is the caller graph for this function:| std::string belofte::to_string | ( | int16_t | value | ) |
std::to_string not compatible on Mac OS (Apple LLVM version 5.0) provide generic utility function
Definition at line 186 of file util.cpp.
Referenced by cmd_perft::execute(), TimedExecution::getDuration(), bBasicBoard::getFEN(), bel_debug::info(), bLevel::operator std::string(), bPgnMoveList::operator<<, bEpd::parse(), bEpd::parsePerftPosition(), prettyTime(), SearchAlphaBeta::Quiescence(), bel_debug::run_bench(), engineInterface::scoreAsString(), UCIMode::scoreString(), XboardMode::scoreString(), UCIMode::sendInfoCurrMove(), UCIMode::sendInfoDepth(), UCIMode::sendInfoSearching(), UCIMode::sendInfoSearching(), and bEpd::setPos().
Here is the caller graph for this function:| std::string belofte::alltrim | ( | std::string | s, |
| std::string const & | delim = " " ) |
trim left and right spaces or delim from string
Definition at line 210 of file util.cpp.
Referenced by bBasicBoard::bBasicBoard(), cmd_setoption::execute(), bEpd::parsePerftPosition(), bEpd::parseSTSPosition(), bEpd::setPos(), and stringSplit().
Here is the caller graph for this function:| bool belofte::is_number | ( | std::string const & | s | ) |
Definition at line 220 of file util.cpp.
Referenced by bEpd::setPos().
Here is the caller graph for this function:| int belofte::getRandomInt | ( | int const | nCeil | ) |
return random in between 0 and nCeil - 1
Definition at line 229 of file util.cpp.
Referenced by SearchRandom::CalcBestMove().
Here is the call graph for this function:
Here is the caller graph for this function:| int belofte::getRandomRange | ( | int const | nStart, |
| int const | nMax ) |
Definition at line 242 of file util.cpp.
Referenced by PosEvalStaticBoard::getEndgameEvaluation(), PosEvalPiecesOnly::getEvaluation(), PosEvalStaticBoard::getMatingEvaluation(), PosEvalStaticBoard::getPawnEndingEvaluation(), and PosEvalStaticBoard::getRelativeBoardEval().
Here is the call graph for this function:
Here is the caller graph for this function:| std::string belofte::getRCname | ( | std::string const & | basename | ) |
| int belofte::positionParamIndex | ( | stringList const & | param, |
| std::string const & | find ) |
find position in which param has been found
| param | vector of strings |
| find | string to find |
Definition at line 274 of file util.cpp.
Referenced by cmd_go::execute().
Here is the caller graph for this function:| int belofte::positionParamValue | ( | stringList const & | param, |
| std::string const & | find, | ||
| unsigned long const | nOffSet = 0 ) |
Definition at line 281 of file util.cpp.
Referenced by cmd_go::execute().
Here is the caller graph for this function:| std::string belofte::currentDate | ( | ) |
Definition at line 292 of file util.cpp.
Referenced by bGame::newGame().
Here is the caller graph for this function:| std::string belofte::prettyTime | ( | long const | nTime | ) |
Definition at line 302 of file util.cpp.
Referenced by TimedExecution::getDuration(), bLevel::operator std::string(), and bel_debug::run_bench().
Here is the call graph for this function:
Here is the caller graph for this function:| bWhiteKing const * belofte::cWhiteKingClass = nullptr |
Definition at line 15 of file movelist.cpp.
Referenced by bMoveList::addBlackMoveIfValid(), bMoveList::addBlackPromotionIfValid(), bMoveList::addWhiteMoveIfValid(), bMoveList::addWhitePromotionIfValid(), bPiece_ctor(), bWhitePawn::canMovePreflightCheck(), bWhitePiece::canMovePreflightCheck(), bWhitePiece::canMovePreflightCheck(), bPositionEvaluation::gameEndedResult(), and bWhiteKing::GenerateMoves().
| bBlackKing const * belofte::cBlackKingClass = nullptr |
Definition at line 16 of file movelist.cpp.
Referenced by bMoveList::addBlackMoveIfValid(), bMoveList::addBlackPromotionIfValid(), bMoveList::addWhiteMoveIfValid(), bMoveList::addWhitePromotionIfValid(), bPiece_ctor(), bBlackPawn::canMovePreflightCheck(), bBlackPiece::canMovePreflightCheck(), bBlackPiece::canMovePreflightCheck(), bPositionEvaluation::gameEndedResult(), and bBlackKing::GenerateMoves().
|
static |
Definition at line 15 of file piece.cpp.
Referenced by bPiece_ctor(), and bPiece::getPiece().
|
static |
Definition at line 16 of file piece.cpp.
Referenced by bPiece_ctor(), and bPiece::getPieceChar().
|
static |
Definition at line 17 of file piece.cpp.
Referenced by bPiece_ctor(), bPiece_dtor(), and bPiece::getPieceClass().
|
static |
Definition at line 18 of file piece.cpp.
Referenced by bPiece_ctor(), bBlackPiece::isAttacked(), and bWhitePiece::isAttacked().
|
static |
Definition at line 19 of file piece.cpp.
Referenced by bPiece_ctor().
|
static |
Definition at line 20 of file piece.cpp.
Referenced by bPiece_ctor(), bBlackKing::GenerateMoves(), bWhiteKing::GenerateMoves(), bBlackKing::hasValidMovePreflightCheck(), and bWhiteKing::hasValidMovePreflightCheck().
|
static |
Definition at line 21 of file piece.cpp.
Referenced by bPiece_ctor(), bBlackKnight::GenerateMoves(), bWhiteKnight::GenerateMoves(), bBlackKnight::hasValidMovePreflightCheck(), bWhiteKnight::hasValidMovePreflightCheck(), bBlackPiece::isAttacked(), and bWhitePiece::isAttacked().