35bool init(
const std::string& path);
59std::optional<std::tuple<Move, WDL, int>>
probeRoot(
const Board& board);
Common type definitions and constants for the chess engine.
chess::Board Board
Alias for chess::Board.
Definition Types.h:14
Definition Tablebase.cpp:13
int maxPieces()
Gets the maximum number of pieces supported by the loaded tablebases.
Definition Tablebase.cpp:232
bool available(const Board &board)
Checks if a position is within the tablebase piece limits.
Definition Tablebase.cpp:42
std::optional< std::tuple< Move, WDL, int > > probeRoot(const Board &board)
Probes the Distance-to-Zero (DTZ) table for root moves.
Definition Tablebase.cpp:99
int wdlToScore(WDL wdl, int mate_ply)
Converts a WDL result to a centipawn score for search evaluation.
Definition Tablebase.cpp:209
WDL
Tablebase probe result for Win-Draw-Loss.
Definition Tablebase.h:21
@ DRAW
Forced draw.
Definition Tablebase.h:24
@ CURSED_WIN
Win, but thwarted by the 50-move rule (draw).
Definition Tablebase.h:23
@ WIN
Forced win.
Definition Tablebase.h:22
@ BLESSED_LOSS
Loss, but saved by the 50-move rule (draw).
Definition Tablebase.h:25
@ LOSS
Forced loss.
Definition Tablebase.h:26
bool init(const std::string &path)
Initializes tablebases with the given path.
Definition Tablebase.cpp:18
bool isInitialized()
Checks if tablebases have been successfully initialized.
Definition Tablebase.cpp:234
std::optional< WDL > probeWDL(const Board &board)
Probes the Win-Draw-Loss (WDL) table.
Definition Tablebase.cpp:50