mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-24 19:16:49 +08:00
Added test commands.
This commit is contained in:
41
src/uci.cpp
41
src/uci.cpp
@@ -271,6 +271,44 @@ void is_ready(bool skipCorruptCheck)
|
||||
}
|
||||
|
||||
|
||||
// --------------------
|
||||
// <20>e<EFBFBD>X<EFBFBD>g<EFBFBD>p<EFBFBD><70>qsearch(),search()<29>ڌĂ<DA8C>
|
||||
// --------------------
|
||||
|
||||
#if defined(EVAL_LEARN)
|
||||
void qsearch_cmd(Position& pos)
|
||||
{
|
||||
cout << "qsearch : ";
|
||||
auto pv = Learner::qsearch(pos);
|
||||
cout << "Value = " << pv.first << " , " << UCI::value(pv.first) << " , PV = ";
|
||||
for (auto m : pv.second)
|
||||
cout << UCI::move(m, false) << " ";
|
||||
cout << endl;
|
||||
}
|
||||
|
||||
void search_cmd(Position& pos, istringstream& is)
|
||||
{
|
||||
string token;
|
||||
int depth = 1;
|
||||
int multi_pv = (int)Options["MultiPV"];
|
||||
while (is >> token)
|
||||
{
|
||||
if (token == "depth")
|
||||
is >> depth;
|
||||
if (token == "multipv")
|
||||
is >> multi_pv;
|
||||
}
|
||||
|
||||
cout << "search depth = " << depth << " , multi_pv = " << multi_pv << " : ";
|
||||
auto pv = Learner::search(pos, depth, multi_pv);
|
||||
cout << "Value = " << pv.first << " , " << UCI::value(pv.first) << " , PV = ";
|
||||
for (auto m : pv.second)
|
||||
cout << UCI::move(m, false) << " ";
|
||||
cout << endl;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/// UCI::loop() waits for a command from stdin, parses it and calls the appropriate
|
||||
/// function. Also intercepts EOF from stdin to ensure gracefully exiting if the
|
||||
/// GUI dies unexpectedly. When called with some command line arguments, e.g. to
|
||||
@@ -333,6 +371,9 @@ void UCI::loop(int argc, char* argv[]) {
|
||||
// <20>J<EFBFBD><4A><EFBFBD><EFBFBD><EFBFBD>̋<EFBFBD><CC8B>t<EFBFBD>ǖʐ<C796><CA90><EFBFBD><EFBFBD>R<EFBFBD>}<7D><><EFBFBD>h
|
||||
else if (token == "gensfen2019") Learner::gen_sfen2019(pos, is);
|
||||
#endif
|
||||
// <20>e<EFBFBD>X<EFBFBD>g<EFBFBD>p<EFBFBD><70>qsearch(),search()<29>ڌĂԃR<D483>}<7D><><EFBFBD>h
|
||||
else if (token == "qsearch") qsearch_cmd(pos);
|
||||
else if (token == "search") search_cmd(pos, is);
|
||||
|
||||
#endif
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user