🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.chess
Article #5168

Re: pl69 error

#5168
From: Tim Mann
Date: Thu, 07 Apr 1994 00:31
105 lines
5412 bytes
> When I Edit Position, using xboard, and set Two Machines, gnuchessx
> makes 1 move (1 white, 1 black) then freezes.  The clocks stop, and I
> can`t quit xboard.

Thanks for the report.  This is a new bug in gnuchess.  I found it in
pl68 as well as pl69.  I don't know when it originated.

The problem is that the "new" command no longer turns on the "beep"
flag; it leaves beep in its previous state.  Thus when xboard tries to
start a new game and turn off the beep by sending the commands
"new\nbeep\n", it sometimes turns on the beep instead.  

xboard chokes when gnuchess sends a beep, because xboard expects to
receive only complete lines (ending with \n) from gnuchess.  The beep
comes as a single character with no trailing newline.  xboard hangs
after reading it, waiting for a newline.

Perhaps this change was meant to be a feature, so that a user running
gnuchess from the command line can turn off the beep and keep it off.
I see that random, easy, and other flags also are not reset to their
initial values anymore.  Unfortunately, these changes break
xboard---because the commands toggle the flags rather than setting
them to a known state, xboard needs to know the current state whenever
it uses one of them.  Therefore, changing how "new" affects the flags
from one version of gnuchess to another is bound to cause problems.

Perhaps the best hack to fix this is to put back the resetting of the
flags in "new", but make it conditional on #ifdef XBOARD, so only
gnuchessx works this way.  This way the other versions get the
"improved" user interface.

Another bug:  The "help" command no longer reports the correct state
of the beep flag.  After the label "Beep:", it prints the value of the
cache flag instead of the beep flag.

Another small bug: ttable.h contains some preprocessor directives
where the # is not in the left column.  This is illegal and (at least)
many preprocessors reject it.

Below is a patch for these problems.  

By the way, I think we need to add a "version" command to gnuchess.
This will let future versions of xboard take advantage of new features
that are added to gnuchess while still working with old versions of
gnuchess.  I do a little of this in a very ad-hoc way right now, by
trying various commands that may or may not be there, and turning off
my use of them if I get an "Illegal move" message back.  (Naturally,
any new features still need to be added without changing the meaning
of existing commands, so that existing versions of xboard will keep
working with new versions of gnuchess.)

	--Tim
*** dspcom.c.~1~        Mon Mar 28 06:05:01 1994
--- dspcom.c    Wed Apr  6 17:20:41 1994
***************
*** 1150,1155 ****
--- 1150,1161 ----
        else if (strcmp (s, CP[172]) == 0)      /*new*/
        {
          NewGame ();
+ #ifdef XBOARD
+         /* Make this work the old way for compatibility */
+         flag.beep = true;
+         dither = 0;
+         flag.easy = true;
+ #endif XBOARD
          UpdateDisplay (0, 0, 1, 0);
        }
        else if (strcmp (s, CP[171]) == 0)      /*list*/
*** nondsp.c.~1~        Sun Mar 27 22:31:10 1994
--- nondsp.c    Wed Apr  6 17:05:10 1994
***************
*** 156,162 ****
          (dither) ? CP[93] : CP[92], (flag.easy) ? CP[93] : CP[92]);
    /*printz ("Beep:     %-12s Transposition file: %s\n",*/
    printz (CP[36],
!         (flag.cache) ? CP[93] : CP[92], (flag.hash) ? CP[93] : CP[92]);
    /*printz ("Time Control %s %d moves %d seconds %d opr %d depth\n", (TCflag) ? "ON" : "OFF",*/
  if(flag.gamein)
    printz (CP[230], (TCflag) ? CP[93] : CP[92],
--- 156,162 ----
          (dither) ? CP[93] : CP[92], (flag.easy) ? CP[93] : CP[92]);
    /*printz ("Beep:     %-12s Transposition file: %s\n",*/
    printz (CP[36],
!         (flag.beep) ? CP[93] : CP[92], (flag.hash) ? CP[93] : CP[92]);
    /*printz ("Time Control %s %d moves %d seconds %d opr %d depth\n", (TCflag) ? "ON" : "OFF",*/
  if(flag.gamein)
    printz (CP[230], (TCflag) ? CP[93] : CP[92],
*** ttable.h.~1~        Mon Mar 28 06:05:14 1994
--- ttable.h    Tue Apr  5 12:38:52 1994
***************
*** 156,161 ****
  extern long EADD, EGET; /* Evaluation cache stats counters */
  extern unsigned long HashCnt, HashAdd, FHashCnt, FHashAdd, HashCol, THashCol;
  #else
!       #define ClearHashStats()                /* stats calls ignored */
!       #define ShowHashStats()
  #endif
--- 156,161 ----
  extern long EADD, EGET; /* Evaluation cache stats counters */
  extern unsigned long HashCnt, HashAdd, FHashCnt, FHashAdd, HashCol, THashCol;
  #else
! #define ClearHashStats()              /* stats calls ignored */
! #define ShowHashStats()
  #endif
Technical Details
Message-ID: <2nvk86$f7u@src-news.pa.dec.com>
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!netnews.upenn.edu!news.amherst.edu!news.mtholyoke.edu!news.byu.edu!gatech!swrinde!elroy.jpl.nasa.gov!decwrl!src.dec.com!mann
References: <2nugco$2ob@gap.cco.caltech.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d71d,3e1371ff1d75c42b
X-Google-Attributes: gid10d71d,public
X-Google-ArrivalTime: 1994-04-06 17:31:02 PST
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!netnews.upenn.edu!news.amherst.edu!news.mtholyoke.edu!news.byu.edu!gatech!swrinde!elroy.jpl.nasa.gov!decwrl!src.dec.com!mann
From: mann@src.dec.com (Tim Mann)
Newsgroups: gnu.chess
Subject: Re: pl69 error
Date: 7 Apr 1994 00:31:02 GMT
Organization: DEC Systems Research Center
Lines: 105
Message-ID: <2nvk86$f7u@src-news.pa.dec.com>
References: <2nugco$2ob@gap.cco.caltech.edu>
NNTP-Posting-Host: cypress.pa.dec.com
Keywords: error, chess, cantelopes