Computer Chess Club Archives


Search

Terms

Messages

Subject: Buffered Input Problem with WinBoard :(

Author: Stanislav Goldovski

Date: 08:32:56 06/15/98


Hello,

I'm creating a chess engine in C and want it to be compatible with
WinBoard. One thing I want to implement is recognizing "?" command
from WinBoard to my engine - that is the "Move Now" feature.

For some reason, this "?" goes not directly to my engine, but to
the input buffer, so that the engine doesn't "move now".
I try to resolve this with "setbuf(stdin, NULL);" and also
I do "fflush(stdin)" just before checking the input with "getch".
Still - my program gets "?" only after it makes the move, i.e.
when it's already too late for "move now".

Surprisngly, when I compile that with BC 3.1 it works corretcly,
but when I compile with VC 4.0 (as Win32 console application) it
does not. :(


Could anyone help me?

Thanks a lot in advance,
Stan



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.