Belofte version 2.1.9
A promising chess program using the UCI or Winboard interface
engineinterface.cpp
Go to the documentation of this file.
1/*---------------------------------------------------------------------+
2 * File: engineinterface.cpp
3 * Project: part of belofte - A Promising Chess Program
4 * Author: yves
5 * SPDX-License-Identifier: GPL-2.0-only
6+----------------------------------------------------------------------*/
7
8#include "belofte.h"
9
10//-----------------------------------------------------------------------
11
12/**
13 * Common commands to all modes
14 * this ctor is called for each iface
15 */
16engineInterface::engineInterface(std::string const& n, std::string const& h)
17 : m_name{n}
18 , m_hint{h}
19 , m_allowedCommands{}
20{
21 initCommand({new cmd_about(), new cmd_accepted(), new cmd_again(),
22 new cmd_alg(), new cmd_bd(), new cmd_belofte(), new cmd_black(),
23 new cmd_bench(), new cmd_computer(),
24 new cmd_debug(), new cmd_dot(), new cmd_easy(),
25 new cmd_echo(), new cmd_epd(), new cmd_epdpos(), new cmd_eval(),
26 new cmd_evaltype(), new cmd_exec(), new cmd_execat(), new cmd_exit(),
27 new cmd_expect(), new cmd_export(), new cmd_fd(),
28 new cmd_force(), new cmd_game(),
29 new cmd_go(), new cmd_hard(), new cmd_help(), new cmd_info(),
30 new cmd_playother(), new cmd_isready(), new cmd_level(), new cmd_ls(),
31 new cmd_new(), new cmd_nopost(),
32 new cmd_option(), new cmd_otim(), new cmd_perft(),
33 new cmd_ping(), new cmd_ponderhit(), new cmd_position(),
34 new cmd_post(), new cmd_protover(),
35 new cmd_questionmark(), new cmd_quit(), new cmd_rejected(),
36 new cmd_random(), new cmd_remove(),
37 new cmd_result(), new cmd_save(), new cmd_sd(), new cmd_st(),
38 new cmd_setboard(), new cmd_setoption(), new cmd_stop(),
39 new cmd_time(), new cmd_uci(), new cmd_ucinewgame(), new cmd_undo(),
40 new cmd_usage(), new cmd_usermove(), new cmd_white(),
41 new cmd_UCI_Opponent(), new cmd_name(),
43 new cmd_xboard()});
44}
45
47{
48 m_allowedCommands.clear();
49 engineCommands_t::iterator itr = getEngineCommands().begin();
50 while (itr != getEngineCommands().end()) {
51 delete itr->second;
52 itr = getEngineCommands().erase(itr);
53 }
54 getEngineCommands().clear();
55}
56
57//-----------------------------------------------------------------------
58// global verbs valid in all cases
59//-----------------------------------------------------------------------
60
61void engineInterface::execute(std::string const& command, std::string const& params)
62{
63 if (command != "") {
64 if (getEngineCommands().find(command) != getEngineCommands().end()) {
66 v->execute(params);
67 } else {
68 sendError("unknown command, not executing",
69 command + (params.size() ? " <" + params + ">" : ""));
70 }
71 }
72}
73
74void engineInterface::initCommand(std::vector<engineUserCommand *> cmds)
75{
76 for (size_t i = 0; i < cmds.size(); ++i) {
77 if (getEngineCommands().find(cmds[i]->m_name) == getEngineCommands().end()) {
78 // do not initialize twice
79 getEngineCommands().insert(std::make_pair(cmds[i]->m_name, cmds[i]));
80 }
81 }
82}
83
85 bool const published)
86{
87 if (published) {
88 /// @todo fix: if not published, add command to list anyway
89 for (size_t i = 0; i < sCommands.size(); ++i) {
90 m_allowedCommands[sCommands[i]] = published;
91 }
92 }
93}
94
95/**
96 * Send help on command or all commands
97 * @param args --all means all commands, '' or a single command
98 * unsupported means all plus unsupported commands
99 * hidden means all plus hidden commands
100 */
101void engineInterface::sendHelp(std::string const& args)
102{
103 belofte::stringList sParams = belofte::stringSplit(args, " ");
104 bool bUnsupported = std::any_of(sParams.begin(), sParams.end(),
105 [](std::string const& s)
106 { return s == "unsupported"; });
107 bool bUnpublished = std::any_of(sParams.begin(), sParams.end(),
108 [](std::string const& s)
109 { return s == "hidden"; });
110 if (bUnsupported || bUnpublished || args == "") {
111 // trigger all case
112 sParams.emplace_back("all");
113 }
114 if (std::any_of(sParams.begin(), sParams.end(),
115 [](std::string const& s)
116 { return ((s == "all") || (s == "--all")); })) {
117 App().bout << "Help for " MYNAME " - mode: " << m_name << "\n";
118 for (auto const& ec : getEngineCommands()) {
119 engineUserCommand *v = getEngineCommands()[ec.first];
120 bool bAllowed = m_allowedCommands.find(v->m_name) != m_allowedCommands.end();
121 if (bUnsupported && !v->m_isImplemented) {
122 App().bout << std::left << std::setw(10) << v->m_name
123 << " - " << v->m_hint << " (u)\n";
124 } else if ((bUnpublished || bAllowed) && v->m_isImplemented) {
125 App().bout << std::left << std::setw(10) << v->m_name
126 << " - " << v->m_hint << (bAllowed ? "\n" : " (h)\n");
127 }
128 }
129 if (bUnsupported) App().bout << "\nu: Unsupported.";
130 if (bUnpublished) App().bout << "\nh: Hidden";
131 } else {
132 App().bout << "Help for " MYNAME << "\n";
133 if (getEngineCommands().find(args) != getEngineCommands().end()) {
134 engineUserCommand const *v = getEngineCommands()[args];
135 App().bout << std::left << std::setw(10) << v->m_name
136 << " - " << v->m_hint << "\n";
137 if (!v->m_isImplemented)
138 App().bout << "\n** Unsupported **";
139 } else {
140 App().bout << "Unknown command [" << args << "]";
141 }
142 }
143 App().bout.endl();
144}
145
146//-----------------------------------------------------------------------
147
148void engineInterface::sendInfoSearchStart(std::string const& info)
149{
150 sendInfo(info);
151}
152
153void engineInterface::sendResponse(std::string const& response)
154{
155 App().bout << response;
156 App().bout.endl();
157}
158
159void engineInterface::sendError(std::string const& error, std::string const& description)
160{
161 App().bout(-2) << "ERROR: " << error;
162 if (!description.empty()) App().bout << " (" << description << ")";
163 App().bout.endl();
164}
165
167{
168 App().sout(-2) << "move " << bPgnMove(b, m.getBMoveT());
169 App().sout.endl();
170}
171
172void engineInterface::sendResult(bBoard const& b UNUSED, gameResult_t const gr) const
173{
174 if (gr != GR_UNKNOWN) {
175 // end of game, so stop running
176 AppEI()->setRunning(false);
177 App().sout(-2) << Game()->getResult(gr);
178 App().sout.endl();
179 }
180}
181
182//-----------------------------------------------------------------------
183
185{
186 if (score > 0) {
187 if (score > SCORE_ALMOST_NORMAL) {
188 if (score == SCORE_INFINITE) return BE_INF;
189 if (score == SCORE_THEORETIC_DRAW) return BE_DRAW;
190 return BE_UNDEFINED;
191 }
192 if (score > SCORE_WINNING) {
193 // mate or mate in n moves
194 if (score >= SCORE_MATE - SCORE_CONVERGE_BYDEPTH) return "mate";
195 else return "M" + belofte::to_string((SCORE_MATE - score + 1) / 2);
196 }
197 } else if (score < 0) {
198 if (score < -SCORE_ALMOST_NORMAL) {
199 if (score == -SCORE_INFINITE) return "-" BE_INF;
200 if (score == SCORE_PRACTICAL_DRAW) return BE_DRAW;
201 return BE_UNDEFINED;
202 }
203 if (score < -SCORE_WINNING) {
204 // mate or mate in n moves
205 if (score <= -SCORE_MATE + SCORE_CONVERGE_BYDEPTH) return "mate";
206 else return "-M" + belofte::to_string((SCORE_MATE + score) / 2);
207 }
208 } else {
209 return "0";
210 }
211 return belofte::to_string(score);
212}
213
215{
216 if (gr == GR_UNKNOWN) {
217 return "";
218 } else if (gr == GR_DRAW_STALEMATE) {
219 return "Stalemate";
220 } else if (gr == GR_DRAW_LACKMATERIAL) {
221 return "Draw by insufficient material";
222 } else if (gr == GR_DRAW_THREEFOLD) {
223 return "Draw by repetition";
224 } else if (gr == GR_DRAW_50) {
225 return "50 move rule";
226 } else if (gr >= GR_DRAW_ADJ && gr <= GR_DRAW_OTHER) {
227 return "Draw";
228 } else if (gr == GR_WHITEMATES) {
229 return "White mates";
230 } else if (gr == GR_BLACKMATES) {
231 return "Black mates";
232 }
233 /// @todo add other end of game conditions
234
235 return "";
236}
237
238//-----------------------------------------------------------------------
239
241 : engineInterface("belofte", "Swith to xboard or UCI protocol")
242{
243 attachCommand({"usage", "version", "exec", "ls"}, false);
244 attachCommand({"about", "xboard", "uci", "help", "bench", "perft"});
245}
246
248{
249 App().bout << MYLCNAME << "> ";
250}
251
252//-----------------------------------------------------------------------
253
254UCIMode::UCIMode(std::string const& s)
255 : engineInterface(s)
256{
257 attachCommand({"belofte"}, false);
258 attachCommand({"uci", "setoption", "isready", "position", "go",
259 "stop", "ucinewgame", "ponderhit"});
260}
261
262void UCIMode::sendMove(bBoard& b UNUSED, bMove const& m)
263{
264 std::stringstream sOut;
265 sOut << "bestmove " << bCoordMove(m);
266 //// @todo: retrieve ponder out of board
267 /// if (ponder != "") sOut << " ponder " << ponder;
268 App().sout(-2) << sOut.str();
269 App().sout.endl();
270}
271
272void UCIMode::sendResult(bBoard const& b UNUSED, gameResult_t const gr UNUSED) const
273{
274 /*
275 if (gr != GR_UNKNOWN) {
276 App().sout(-2) << "bestmove 0000";
277 App().sout.endl();
278 }
279 */
280}
281
282void UCIMode::sendInfo(std::string const& info)
283{
284 App().sout << "info string ";
285 App().sout << info;
286 App().sout.endl();
287}
288
289void UCIMode::sendDebug(int const l, std::string const& info)
290{
291 App().bout(l) << "info string ";
292 App().bout << info;
293 App().bout.endl();
294}
295
296void UCIMode::sendInfoDepth(int depth, int seldepth, int64_t nodes, int nps)
297{
298 if (depth <= App().sout.getLevel()) {
299 std::stringstream sOut;
300 sOut << "info depth " << belofte::to_string(depth)
301 << " seldepth " << belofte::to_string(seldepth)
302 << " nodes " << belofte::to_string(nodes)
303#if defined(NPS_LOG)
304 << " nps " << nps
305#endif
306 ;
307 App().sout << sOut.str();
308 App().sout.endl();
309 }
310}
311
312void UCIMode::sendInfoSearching(bBoard const& b, int const nLogDepth,
313 depth_t const nMaxDepth,
314 bScore const sc, int64_t const timems,
315 int64_t const nodes) const
316{
317 int nVariationDepth = static_cast<int>(b.getVariation().size());
318 std::stringstream sOut;
319 sOut << "info depth " << belofte::to_string(nLogDepth);
320 if (nMaxDepth > nLogDepth)
321 sOut << " seldepth " << belofte::to_string(static_cast<int16_t>(nMaxDepth));
322#if defined(NPS_LOG)
323 sOut << " time " << belofte::to_string(timems);
324#endif
325 if (timems > 10) {
326 sOut << " nodes " << belofte::to_string(nodes)
327#if defined(NPS_LOG)
328 << " nps " << belofte::to_string((nodes * 1000)/ timems)
329#endif
330 ;
331 }
332 sOut << scoreString(sc);
333 if ((nLogDepth == 0) && nVariationDepth) {
334 sOut << " pv";
335 for (std::string const& m : b.getPreviousMoves()) sOut << " " << m;
336 for (std::string const& m : b.getVariation()) sOut << " " << m;
337 } else {
338 if (b.getPreviousMoves().size()) {
339 /// @todo only print currline in case requested by UI
340 sOut << " currline";
341 for (std::string const& m : b.getPreviousMoves()) sOut << " " << m;
342 }
343 if (nVariationDepth) {
344 sOut << " pv";
345 for (std::string const& m : b.getPreviousMoves()) sOut << " " << m;
346 for (std::string const& m : b.getVariation()) sOut << " " << m;
347 }
348 }
349 App().sout << sOut.str();
350 App().sout.endl();
351}
352
353/**
354 * Called from root search, can also be called with comments
355 * from other depths
356 */
357void UCIMode::sendInfoSearching(bBoard const& b, int const nLogDepth,
358 depth_t const nMaxDepth, std::string const& comment,
359 bScore const sc, int64_t const timems,
360 int64_t const nodes) const
361{
362 int nVariationDepth = static_cast<int>(b.getVariation().size());
363 std::stringstream sOut;
364 if (nLogDepth) {
365 // not called from root
366 sOut << "info depth " << belofte::to_string(nLogDepth);
367 if (nMaxDepth > nLogDepth)
368 sOut << " seldepth " << belofte::to_string(static_cast<int16_t>(nMaxDepth));
369 } else if (nVariationDepth) {
370 // called from root, UCI requires us to send a depth
371 sOut << "info depth " << belofte::to_string(nVariationDepth);
372 if (nMaxDepth > nVariationDepth)
373 sOut << " seldepth " << belofte::to_string(static_cast<int16_t>(nMaxDepth));
374 } else {
375 // other cases
376 sOut << "info";
377 }
378#if defined(NPS_LOG)
379 sOut << " time " << belofte::to_string(timems);
380 if (nodes && (timems > 10))
381 sOut << " nodes " << belofte::to_string(nodes)
382 << " nps " << belofte::to_string((nodes * 1000)/ timems);
383#else
384 if (nodes)
385 sOut << " nodes " << belofte::to_string(nodes);
386#endif
387 sOut << scoreString(sc);
388 if ((nLogDepth == 0) && nVariationDepth) {
389 sOut << " pv";
390 for (std::string const& m : b.getPreviousMoves()) sOut << " " << m;
391 for (std::string const& m : b.getVariation()) sOut << " " << m;
392 } else {
393 if (b.getPreviousMoves().size()) {
394 /// @todo only print currline in case requested by UI
395 sOut << " currline";
396 for (std::string const& m : b.getPreviousMoves()) sOut << " " << m;
397 }
398 if (nVariationDepth) {
399 sOut << " pv";
400 for (std::string const& m : b.getPreviousMoves()) sOut << " " << m;
401 for (std::string const& m : b.getVariation()) sOut << " " << m;
402 }
403 }
404 if (comment != "") sOut << " string " << comment;
405 App().sout << sOut.str();
406 App().sout.endl();
407}
408
410 depth_t const nCurDepth,
411 bMove const& mv, movenum_t const moveid, int64_t const nodes) const
412{
413 int nVariationDepth = static_cast<int>(b.getVariation().size());
414 std::stringstream sOut;
415 sOut << "info depth " << belofte::to_string(nCurDepth);
416 if (nVariationDepth > nCurDepth)
417 sOut << " seldepth " << belofte::to_string(nVariationDepth);
418 sOut << " nodes " << belofte::to_string(nodes);
419 sOut << " currmovenumber " << belofte::to_string(moveid);
420 sOut << " currmove ";
421 sOut << mv;
422 App().sout << sOut.str();
423 App().sout.endl();
424}
425
426std::string UCIMode::scoreString(bScore const score) const
427{
428 bScore mateinx = 0;
429 if ((score < SCORE_ALMOST_NORMAL) && (score > SCORE_WINNING)) {
430 mateinx = SCORE_MATE + 1 - score;
431 } else if ((score > -SCORE_ALMOST_NORMAL) && (score < -SCORE_WINNING)) {
432 mateinx = SCORE_MATE - 1 + score;
433 }
434 if (mateinx) {
435 return " score mate " + belofte::to_string(mateinx);
436 } else if (bSearchScore::isUndefinedScore(score)) {
437 // skip output
438 } else if (score == -SCORE_INFINITE) {
439 return " score lowerbound";
440 } else if (score == SCORE_INFINITE) {
441 return " score upperbound";
442 } else if (bSearchScore::isDrawScore(score)) {
443 return " score 0";
444 } else {
445 return " score cp " + belofte::to_string(score);
446 }
447 return "";
448}
449
450//-----------------------------------------------------------------------
451
452XboardMode::XboardMode(std::string const& s)
453 : engineInterface(s, "No xboard prompt")
454{
455 attachCommand({"accepted", "belofte", "black", "option", "otim", "ping",
456 "time", "rejected", "white"}, false);
457 attachCommand({"bd", "undo", "new", "setboard", "usermove", "game",
458 "remove", "force", "level", "post", "nopost", "random",
459 "easy", "hard", "go", "?", "result", "sd", "st", "protover"});
460}
461
462void XboardMode::sendInfo(std::string const& info)
463{
464 App().sout << "# "; /// @todo check if line needs to be split for respecting tmplevel
465 App().sout << info;
466 App().sout.endl();
467}
468
469void XboardMode::sendDebug(int const l, std::string const& info)
470{
471 App().bout(l) << "# ";
472 App().bout << info; /// @bug why do we need to split in 2 lines?
473 App().bout.endl();
474}
475
476void XboardMode::sendInvalidMove(std::string const& mv, std::string const& reason)
477{
478 App().bout(-2) << "Illegal move: " << mv;
479 if (reason != "") App().bout << " (" << reason << ")";
480 App().bout.endl();
481}
482
483#if defined(__GNUC__)
484#pragma GCC diagnostic push
485#pragma GCC diagnostic ignored "-Wunused-parameter"
486#endif
487
488void XboardMode::sendInfoSearching(bBoard const& b, int const nLogDepth,
489 depth_t const nMaxDepth,
490 bScore const sc, int64_t const t, int64_t const nodes) const
491{
492 int nVariationDepth = static_cast<int>(b.getVariation().size());
493 if (!bSearchScore::isUndefinedScore(sc) && nVariationDepth) {
494 std::stringstream sNew;
495 for (std::string const& m : b.getPreviousMoves()) sNew << " " << m;
496 for (std::string const& m : b.getVariation()) sNew << " " << m;
497 if (sNew.str().size()) {
498 static std::string& sOld = *new std::string();
499 if (sNew.str() != sOld) {
500 // only post updates
501 sOld = sNew.str();
502 App().sout << " " << std::setw(3) << nVariationDepth
503 << (nVariationDepth == nMaxDepth ? " " : "&");
504 App().sout << " " << std::setw(8) << scoreString(sc);
505 App().sout << " " << std::setw(6) << (t / 10);
506 App().sout << " " << std::setw(8) << nodes;
507 App().sout << sOld;
508 App().sout.endl();
509 }
510 }
511 }
512}
513
514#if defined(__GNUC__)
515#pragma GCC diagnostic pop
516#endif
517
518void XboardMode::sendResult(bBoard const& b, gameResult_t const gr) const
519{
520 gameResult_t ngr = gr;
521 if (ngr != GR_UNKNOWN) {
522 // end of game, so stop running
523 AppEI()->setRunning(false);
524 App().sout(-2) << Game()->getResult(ngr);
527 }
529 App().sout.endl();
530 }
531}
532
533std::string XboardMode::scoreString(bScore const score) const
534{
535 int localscore = score;
536
537 if (localscore >= SCORE_WINNING && localscore <= SCORE_MATE) {
538 localscore = (-localscore + SCORE_MATE) + 100000;
539 } else if (localscore <= -SCORE_WINNING && localscore >= -SCORE_MATE) {
540 localscore = (-localscore - SCORE_MATE) - 100000;
541 }
542 return belofte::to_string(localscore);
543}
544
546{
547 std::string sResult = engineInterface::engineGameResultString(gr);
548 if (sResult != "") return " {" + sResult + "}";
549 return sResult;
550}
551
552//-----------------------------------------------------------------------
553
554// eof
appInstance & App()
Definition belofte.cpp:225
engineInterface * AppEI()
Definition belofte.cpp:231
bGame * Game()
Definition belofte.cpp:236
This is the main include file, needs to be included before any other include.
#define MYLCNAME
Definition belofte.h:32
uint_fast8_t movenum_t
Definition belofte.h:100
#define MYNAME
Definition belofte.h:31
int_fast8_t depth_t
Definition belofte.h:103
void sendPrompt() override
void sendDebug(int const l, std::string const &info) override
void sendResult(bBoard const &b, gameResult_t const gr) const override
void sendInfoCurrMove(bBoard const &b, depth_t const nCurDepth, bMove const &m, movenum_t const moveid, int64_t const nodes) const override
void sendInfoDepth(int depth, int seldepth, int64_t nodes, int nps) override
void sendMove(bBoard &b, bMove const &m) override
void sendInfoSearching(bBoard const &b, int const nLogDepth, depth_t const nMaxDepth, bScore const sc, int64_t const t, int64_t const nodes) const override
std::string scoreString(bScore const score) const override
UCIMode(std::string const &s="uci")
void sendInfo(std::string const &info) override
std::string engineGameResultString(gameResult_t const gr) const override
void sendDebug(int const l, std::string const &info) override
void sendInvalidMove(std::string const &info, std::string const &reason) override
void sendResult(bBoard const &b, gameResult_t const gr) const override
void sendInfoSearching(bBoard const &b, int const nLogDepth, depth_t const nMaxDepth, bScore const sc, int64_t const t, int64_t const nodes) const override
std::string scoreString(bScore const score) const override
void sendInfo(std::string const &info) override
XboardMode(std::string const &s="xboard")
outputWriter sout
normal output
Definition belofte.h:174
outputWriter bout
Definition belofte.h:173
constexpr bmove_t getBMoveT() const
Definition basicmove.h:72
board
Definition board.h:45
movesequence_t const & getPreviousMoves() const
Definition board.h:85
movesequence_t const & getVariation() const
Definition board.h:89
simple coordmove, with 4 characters, or 5 characters in case of promotion mostly used for interface
Definition coordmove.h:15
std::string getResult(gameResult_t gr) const
Definition game.cpp:171
Definition move.h:13
PgnMove is for user-interface only.
Definition pgnmove.h:14
static gameResult_t gameEndedResult(bBoard const &b)
Class static function See if board is in finite state, meaning game is ended.
Definition eval.cpp:42
static bool isDrawResult(gameResult_t const gr)
Definition eval.h:70
static constexpr bool isDrawScore(bScore const score)
static constexpr bool isUndefinedScore(bScore const score)
Parse epd position.
Definition usercmd.h:256
implementation of single command
Definition usercmd.h:128
Definition usercmd.h:464
virtual void sendResult(bBoard const &b, gameResult_t const gr) const
virtual ~engineInterface()
void attachCommand(belofte::stringList const &sCommands, bool const published=true)
virtual void sendResponse(std::string const &response)
engineInterface(std::string const &s, std::string const &h="")
Common commands to all modes this ctor is called for each iface.
static engineCommands_t & getEngineCommands()
virtual void setRunning(bool const r)
virtual void sendMove(bBoard &b, bMove const &m)
virtual void sendHelp(std::string const &args)
Send help on command or all commands.
virtual std::string engineGameResultString(gameResult_t const gr) const
void execute(std::string const &command, std::string const &params)
virtual void sendInfo(std::string const &info)
virtual void sendInfoSearchStart(std::string const &info)
virtual void sendError(std::string const &error, std::string const &description)
static std::string scoreAsString(bScore const score)
basic format for single command
Definition usercmd.h:14
std::string m_hint
Definition usercmd.h:33
virtual void execute(std::string const &args)
Definition usercmd.cpp:12
std::string m_name
Definition usercmd.h:32
bool m_isImplemented
Definition usercmd.h:34
outputWriter & endl()
Definition bel_debug.h:68
constexpr bScore SCORE_ALMOST_NORMAL
Definition eval.h:23
@ GR_DRAW_50
Definition eval.h:37
@ GR_DRAW_OTHER
Definition eval.h:38
@ GR_DRAW_STALEMATE
Definition eval.h:37
@ GR_UNKNOWN
Definition eval.h:36
@ GR_WHITEMATES
Definition eval.h:39
@ GR_BLACKMATES
Definition eval.h:40
@ GR_DRAW_LACKMATERIAL
Definition eval.h:37
@ GR_DRAW_THREEFOLD
Definition eval.h:37
@ GR_DRAW_ADJ
Definition eval.h:38
constexpr bScore SCORE_MATE
Definition eval.h:24
enum gameResult gameResult_t
Definition eval.h:43
int16_t bScore
Definition eval.h:11
constexpr bScore SCORE_PRACTICAL_DRAW
Definition eval.h:18
constexpr bScore SCORE_CONVERGE_BYDEPTH
Definition eval.h:30
constexpr bScore SCORE_WINNING
Definition eval.h:25
constexpr bScore SCORE_THEORETIC_DRAW
Definition eval.h:17
constexpr bScore SCORE_INFINITE
Definition eval.h:19
std::string to_string(int16_t value)
std::to_string not compatible on Mac OS (Apple LLVM version 5.0) provide generic utility function
Definition util.cpp:171
stringList const stringSplit(std::string src, std::string const &delim)
Split delimited long string into a vector.
Definition util.cpp:133
std::vector< std::string > stringList
Definition util.h:46
#define BE_DRAW
Definition search.h:63
#define BE_UNDEFINED
Definition search.h:62
#define BE_INF
Definition search.h:61