Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Engine programming - standard input

Author: Matt Thomas

Date: 22:18:34 12/03/03

Go up one level in this thread


On December 03, 2003 at 09:43:38, Robert Hyatt wrote:

>On December 03, 2003 at 05:08:14, Matt Thomas wrote:
>
>>I want to create a chess engine and am starting with the input/output routines.
>>I can handle output, but am not sure about how to implement input.  I am
>>thinking to use ReadFile() to be unbuffered, and for pipes.  I could implement a
>>loop to poll for input, but wouldn't that be a drag on CPU cycles?  I want to be
>>able to use pondering, but if the user decided to cancel the game I need to
>>listen for the command.  I am going to use the Winboard protocol and understand
>>the commands.  I am using VC6 to create a console app and am familiar with
>>creating a basic program in Windows/console/DOS.  Any help would be much
>>appreciated.  Examples would go a long way.  I have looked at some code for
>>other chess programs, but there is so much to sift thru and I want to focus
>>specifically on understanding the basics of implementing std input.  Thanks,
>>Matt
>
>
>1.  use Read().
>
>2.  "poll" using select() (assuming unix) with a timeout of 0.0, which simply
>asks the question "Is input available for me to read on stdin?"  If the answer
>is no, do whatever you want.  If the answer is yes, read it.  If you don't
>have anything to do, just do a read() to get the next command...

I agree on using Read() - it looks advantageous.  So isn't polling every clock
cycle kind of a drain of CPU?  What do you think of skipping clock cycles to
give more time to pondering?  I am still forming a plan in my mind of what I
want to see happen.  I definitely want to implement pondering.  I am developing
on a Win98 platform using VC6.  I have other OS options like Win2k, XP,
Mandrake.  But I tend to favor my gaming OS. BTW I did take a look at your
Crafty code. Wow!  You don't happen to have a walkthru for it somewhere do you?
A guy could get lost in there... :)  Thanks for the reply, Matt



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.