Thanks HG!
hgm wrote:If you want the engine to ponder, it is important that it checks if there is input regularly during the pondering, because the opponent could move. On Windows you can use PeekNamedPipe for this. When it is its own turn it can afford to ignore all input. (The only adverse effect is that 'Move Now' would not work, and that the engine would not notice opponent resigns or draw offers before it moves.)
Beyond my understanding for the moment, I made my engine in FreeBasic, what I found about that PeekNamedPipe is in C++ for now.... but actually I just want to make a working engine and now it seems just become unresponding only if forfait by time.
hgm wrote:
The engine is supposed to keep track of the time it has been thinking, and move when it has used up the time it could afford.
OK! I´m trying this now then.
Not knowing how much time the engine need to calculate the next move, after each attempted move it testing if the time it have after the last "time" command is ended or not. If ended, interrupt its calculationg, reset al variables and return to Xboard subroutine to listen the GUI.
And in fact it doing. Before this time control is added to my engine, the engine attempts to do a new move after GUI saids its forfait by time and not now.
More than this, its respond to the ping command as it can be see in the image below (BTW, why is not this the first command GUI sends to engine to know if it is listening or not?)
But my question now is:
How the GUI knows that an engine is "already calculating"?
What is the meaning of "already calculating"?
As far as I could understood, my engine is listening to the GUI but no command but "computer" was sent from GUI to my engine after "ping" command that not was listened.
I´m pretty sure the time between "ping" and "already calculating" (0.072 secs) is enough to my engine to be listening again.
