Author: Robert Hyatt
Date: 17:38:12 09/17/04
Go up one level in this thread
On September 17, 2004 at 18:04:48, martin fierz wrote: >aloha! > >i just spent friday night implementing pondering in my chess program. hmm, make >that 3 questions, the first being "should i get a life?" :-) > >anyway, back to the two questions - they are really rather stupid, but well... > >1) i'm using PeekNamedPipe to look whether there is any command for my program, >and i'm looking for "ponderhit". when i find that, i'd like to flush the >standard input. however, "fflush(stdin);" doesn't help, the ponderhit command >stays where it is and is seen by every next call to my standard-input-polling >function. i now use "gets(input)" where input is a string, and then the >ponderhit command disappears and is not seen by the next call to PeekNamedPipe. > >can somebody tell me why fflush(stdin) won't work? I assume you type "ponderhit" when you ponder the correct move? Why not type the move itself? Fewer keystrokes. :) > >2) when i receive a ponderhit command but have used a lot of time, i abort the >search. so my PV is now reduced to crap (except for the first ply) and my engine >ponders on a garbage move. is there any more elegant/better way to solve this >than memorizing the PV of the last ply? for instance, i might have had a >fail-high for a new root move, and i don't construct PVs in the middle of the >search, only after every completed ply. but i should construct PVs all the time >(i.e. on every ply, and on every new best move at root level) if i want to >ponder, correct? > >how are you doing this in your program? > 1. Don't clobber the PV when you fail high. But even with that, you can get a 1-move PV at times with hash silliness. What I do is try two things. (a) probe the hash table. If you get a best move, ponder that; (b) swap sides, do a short search to find the best move for your opponent, then come back and ponder that (Crafty calls this "puzzling for a ponder move"). >cheers > martin
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.