Code: Select all
void Proxy::receiveMessage()
{
while (std::getline (std::cin, input ))
{
if(input == "uci")
{
cout << input << "\n";
message << input << endl;
};
}
}
Code: Select all
void Proxy::receiveMessage()
{
while (std::getline (std::cin, input ))
{
if(input == "uci")
{
cout << input << "\n";
message << input << endl;
};
}
}
What do you mean by fails?andypandy wrote:I am trying to program an UCI engine, but the setup fails. Below is a part of the function setting up the engine.
What is wrong?Code: Select all
void Proxy::receiveMessage() { while (std::getline (std::cin, input )) { if(input == "uci") { cout << input << "\n"; message << input << endl; }; } }
This part of code is clearly not relevent in understanding your problem. All it does is read commands, reprints them to stdout and queues them into 'message' (which I suppose is some kind of ostream you defined?).andypandy wrote:I am trying to program an UCI engine, but the setup fails. Below is a part of the function setting up the engine.
What is wrong?Code: Select all
void Proxy::receiveMessage() { while (std::getline (std::cin, input )) { if(input == "uci") { cout << input << "\n"; message << input << endl; }; } }
Code: Select all
=> C++
std::cout << "hello" << std::endl;
=> C equivalent
printf("hello\n");
fflush(stdout);
Well, the protocol says you need to answer with "uciok" otherwise the engine won't run.andypandy wrote:It says it failed to run the engine. The engine does not even get the chance to identify itself. Maybe there are some "standard setup file" avaible or something.