// print engine info
std::cout << "id name Zangdar " << VERSION << std::endl;
std::cout << "id author Philippe Chevalier" << std::endl;
std::cout << "uciok" << std::endl;
This works well with arena, but not with fritz. In the latter case, on the author name is displayed.
I tried to replace std::endl with "\n", with no effect.
No, the module don't load at all. Fritz stays at the window that define a module.
The author name is ok, but there is nothing in the program name.
If I click "validate", nothing happens.
This the code I use. I looked at other engines, and I think i did ok.
void Uci::run()
{
std::string token;
std::string line;
Search* search = new Search();
// print engine info
std::cout << "id name Zangdar " << VERSION << std::endl;
std::cout << "id author Philippe Chevalier" << std::endl;
std::cout << "uciok" << std::endl;
// main loop
while(getline(std::cin, line))
{
std::istringstream is(line);
token.clear();
is >> std::skipws >> token;
//-------------------------------------------- gui -> engine
if (token == "uci")
{
// print engine info
std::cout << "id name Zangdar " << VERSION << std::endl;
std::cout << "id author Philippe Chevalier" << std::endl;
std::cout << "uciok" << std::endl;
}
else if (token == "isready")
{
// synchronize the engine with the GUI
std::cout << "readyok" << std::endl;
continue;
}
else if (token == "position")
{
// set up the position described in fenstring
search->position(is);
}
else if (token == "ucinewgame")
{
// the next search (started with "position" and "go") will be from
// a different game.
search->new_game();
}
...
Here the answer for anyone that have the same problem.
My engine works in 2 modes : cli and uci. The first thing I did was to ask which command the user wanted.
So when I launched my program with Fritz, it received a string like : "What do you want ?".
Not an uci command !! I corrected this behaviour, and it works now.
Thanks to Arena, that show all messages.