Don Cross wrote:I just took my existing chess engine and did the best I could reading the protocol specification to make a WinBoard version.
Wel, it must be he specs that suck then. But that means it is best repaired there.
I don't see there is anything intrnsically difficult here: Move count is a well-defined part of the game state, just like the board position, side to move or 50-move counter. When you do a move, the ply count increments by one. White gets new time in N moves per session after ply 2*N-1, black after 2*N (i.e. when they have done their own N ply), when you start the ply count at 0 (for white-to-move) or 1 (for black-to-move positions).
The start at ply 0 / 1 is what the FEN specifies in a setboard command: currently this will always specify move number 1, implying ply 0 (wtm) or 1 (btm), no matter what move number the FEN you pasted into WinBoard contained. For engines setting up positions through the
edit command, the 0 or 1 are implied (just like castling rghts are implied). Plus that you still will be left with the problem what to do when the featre is rejected...
I don't think counting plies is so difficult that there is a need to have the GUI do it for he engine. The modification to an existing engine needed to make it send the feature, check if the GUI accepts it, and parse the extra parameter in the
time command, is far greater than simply declaring a parameter
int plyCount;, doing
plyCount = 0; on
new,
plyCount = (sideToMove == BLACK); on
edit /
setboard, and writing
movesDone = plyCount/2; when receiving a
time command, rather than trying to read it from the time command.