Dann Corbit wrote:beneficii wrote:OK, I got the program to respond with the features (though I can't ever seem to get Fruit to do that, which is strange). Nevertheless, when I play around in the Console window it never does anything more, but now WinBoard can't initialize it, because it crashes. So in the Console window it doesn't crash, but in WinBoard it does not.
What is a full list of commands that are sent to the engine when WinBoard initializes, so that I can test them?
EDIT: I'm able to get FairyMax to respond.
Can you post your I/O routines?
// checks for input
bool xboard::input_available() {
return PeekNamedPipe(ipipe, NULL, 0, NULL, NULL, NULL);
}
// used during the search to check for input
std::string xboard::get_input() {
char buffer[max_bytes+1];
DWORD num_read;
std::string ret;
while(input_available()) {
ReadFile(ipipe, buffer, max_bytes, &num_read, NULL);
ret.append(buffer, buffer+num_read);
}
return ret;
}
// used to wait for input outside of a search
std::string xboard::wait_input() {
int get;
std::string ret;
while((get = getchar()) != EOF) {
ret += static_cast<char>(get);
if(get == '\n' || get == '\r')
break;
}
return ret;
}
// used to write output
void xboard::write_output(std::string out, ...) {
va_list ap;
va_start(ap, out);
vfprintf(stdout, out.c_str(), ap);
fflush(stdout);
va_end(ap);
}
One problem I notice that I'm having is that the engine never makes a move when opened with WinBoard, but when I use the exact same set of commands I see in the winboard.debug when I open the EXE directly, the engine does work and makes a move.