Ponder console input move problem

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
vladstamate
Posts: 161
Joined: Thu Jan 08, 2009 8:06 pm
Location: San Francisco, USA
Contact:

Ponder console input move problem

Post by vladstamate » Wed Apr 28, 2010 9:42 pm

Hi all,

I added ponder to plisk and logically all works fine. I have a problem however with my code that detects if a move is being fed to the program while it is pondering.

In windows I use the usual PeekNamedPipe/PeekConsoleInput and then if anything is there, I do a fgets to get the move string.

If ran under winboard, so with a pipe, everything seems fine. However if I run from the debugger or a console, it breaks. What happens is that when I do fgets the first 2 chars in the string are replaced by 'p' and 0 (so 70 and 0). So a move like "h2h3" gets transformed into 'p',0,'h','3'. Therefore making it very hard for me to debug some issues I have.

Maybe a memory corruption issue, but why does it not happen in pipe mode? Must be something stupid I do but for the life of me I cannot figure it out.

Has anyone seen anything like this?

Regards,
Vlad.

brianr
Posts: 321
Joined: Thu Mar 09, 2006 2:01 pm

Re: Ponder console input move problem

Post by brianr » Thu Apr 29, 2010 1:24 am

Different input modes are used, unfortunately.

Look at Crafty's CheckInput() in utility.c
where several input options are supported.

Post Reply