Belofte version 2.1.9
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 t) |
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 133 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(), engineInterface::sendHelp(), bEpd::setPos(), and bEpd::translateEpdResult().
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 152 of file util.cpp.
Referenced by bEpd::parseSTSPosition(), and bEpd::setPos().
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 171 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().
std::string belofte::alltrim | ( | std::string | s, |
std::string const & | delim = " " ) |
trim left and right spaces or delim from string
Definition at line 195 of file util.cpp.
Referenced by bBasicBoard::bBasicBoard(), cmd_setoption::execute(), bEpd::parsePerftPosition(), bEpd::parseSTSPosition(), bEpd::setPos(), and stringSplit().
bool belofte::is_number | ( | std::string const & | s | ) |
Definition at line 205 of file util.cpp.
Referenced by bEpd::setPos().
int belofte::getRandomInt | ( | int const | nCeil | ) |
return random in between 0 and nCeil - 1
Definition at line 214 of file util.cpp.
Referenced by SearchRandom::CalcBestMove().
int belofte::getRandomRange | ( | int const | nStart, |
int const | nMax ) |
Definition at line 227 of file util.cpp.
Referenced by PosEvalStaticBoard::getEndgameEvaluation(), PosEvalPiecesOnly::getEvaluation(), PosEvalStaticBoard::getMatingEvaluation(), PosEvalStaticBoard::getPawnEndingEvaluation(), and PosEvalStaticBoard::getRelativeBoardEval().
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 259 of file util.cpp.
Referenced by cmd_go::execute().
int belofte::positionParamValue | ( | stringList const & | param, |
std::string const & | find, | ||
unsigned long const | nOffSet = 0 ) |
Definition at line 268 of file util.cpp.
Referenced by cmd_go::execute().
std::string belofte::currentDate | ( | ) |
Definition at line 279 of file util.cpp.
Referenced by bGame::newGame().
std::string belofte::prettyTime | ( | long const | t | ) |
Definition at line 289 of file util.cpp.
Referenced by TimedExecution::getDuration(), bLevel::operator std::string(), and bel_debug::run_bench().
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(), bWhitePiece::canMovePreflightCheck(), bWhitePiece::canMovePreflightCheck(), bWhitePiece::canPawnMovePreflightCheck(), 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(), bBlackPiece::canMovePreflightCheck(), bBlackPiece::canMovePreflightCheck(), bBlackPiece::canPawnMovePreflightCheck(), 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().