bug-gnu-chess
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug in setboard on version 6.0.3


From: Antonio Ceballos
Subject: Re: bug in setboard on version 6.0.3
Date: Mon, 29 Apr 2013 01:53:34 +0200

Hi Chad,

Thanks a lot for your kind contribution. I will review it as soon as possible in light of incorporating it into the next release of GNU Chess.

Regards,
Antonio Ceballos



On Mon, Apr 22, 2013 at 4:56 PM, Chad Hendry <address@hidden> wrote:
Greetings!

The "setboard" command doesn't seem to be working in 6.0.3.  If I run the following, the engine never comes back with a move:

printf "xboard\nprotover 2\nsetboard r3k2r/pp2bppp/8/3p4/3n4/3NR3/PP1P1PbP/2BK4 b kq - 0 1\nst 1\ngo\n" | ./gnuchess

I noticed that on the other hand, "epdload" seems to be working fine.  From what I can tell, the difference is that cmd_setboard isn't calling SetDataToEngine.  I added the call to cmd_setboard (patch included) and it fixed the issue for me.

Thank you for such a fantastic program!

- chad



diff --git a/src/frontend/cmd.c b/src/frontend/cmd.c
index 9e7c9f5..7417782 100644
--- a/src/frontend/cmd.c
+++ b/src/frontend/cmd.c
@@ -544,9 +544,14 @@ void cmd_save(void)
 
 void cmd_setboard(void)
 {
+  char data[MAXSTR]="";
+
   /* setboard uses FEN, not EPD, but ParseEPD will accept FEN too */
   ParseEPD (token[1]);
   NewPosition();
+
+  snprintf(data, sizeof(data), "setboard %s", token[1]);
+  SetDataToEngine(data);
 }
 
 void cmd_solve(void) { Solve (token[1]); }



_______________________________________________
Bug-gnu-chess mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/bug-gnu-chess



reply via email to

[Prev in Thread] Current Thread [Next in Thread]