Moderators: hgm, Andres Valverde
beneficii wrote:I'm working on an engine, and I have the board representation done, the evaluation done, the searches done, but now I'm trying to set up communication with WinBoard, and I've never done something like that before. It is said that you must communicate via pipes, but in reality the engine would just communicate via stdin and stdout, right? So, do you have something that just keeps checking stdin over and over again until it gets input, and then it acts on that? You have to make sure the buffer is cleared too, so you get every character, right? Then, when your engine needs to communicate with WinBoard, you print the commands on stdout and flush that buffer, right?
I'm writing it in C++. Is there a good library for this available, or will I have to take it like a ninja and write it all from scratch? What are some common pitfalls?
EDIT: I'm not sure where this topic should go; please move it if necessary. Thanks.
beneficii wrote:Also, how often should I check for input? Should I check on every node, or would that take too much time?
time N
otim N
MOVE
Sent when the opponent makes a move and the engine is already playing the opposite color.
time (boolean, default 1, recommended 1)
If time=1, xboard will send the "time" and "otim" commands to update the engine's clocks; if time=0, it will not.
H.G.Muller wrote:That depends on if you are interested in how much time the opponent has on his clock. Most engines simply ignore the otim command.
How do you indicate the Wizzard squares? Do you use coordinates for a 12x12 board, so that a1 is a Wizzard square? (I guess it should be a0 then, based on the rule that counting starts at 0 on boards with more than 9 ranks.) WinBoard does not really implement boards with more than 10 ranks: the PGN parser does not understand double-digit numbers, and rank-number 10 is printed as ':'. Have you patched WinBoard to fix that? I would be very interested to have such a patch in the main line, so we can also implement variants like Big Chess.
The rule that counting starts at 0 only makes sens on a board with 10 ranks, I guess. With 11 ranks you would need double-digit numbers anyway, and you might as well use 10 and 11...
Return to WinBoard development and bugfixing
Users browsing this forum: No registered users and 5 guests