🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sources.bugs
Article #739

Bugfix for Chess game (BSD version)

#739
From: Bill Randle
Date: Fri, 22 May 1987 22:23
81 lines
2896 bytes
Here is a diff to fix the premature checkmate problem in the BSD
patched version of chess that was posted to comp.sources.games.
Only the first sizeof(short *) bytes were being cleared instead
of all 64*sizeof(short) bytes as is required.  I'm sure there are
some other lingering problems, but this should get you started.
(The other two patches are just some minor cleanups.)

	-Bill Randle
	Moderator, comp.sources.games
	Tektronix, Inc.
	games-request@tekred.TEK.COM
------------------------------------

*** chess.c.orig	Fri May 22 15:08:48 1987
--- chess.c	Fri May 22 15:07:59 1987
***************
*** 4,10 ****
      Written by John Stanback (hplabs!hpfcla!hpisla!hpltca!jhs)
  
      Patches for BSD Unix by Rich Salz (rs@mirror.TMC.COM) - 5/3/87
! 
  */ 
  
  #include <stdio.h>
--- 4,10 ----
      Written by John Stanback (hplabs!hpfcla!hpisla!hpltca!jhs)
  
      Patches for BSD Unix by Rich Salz (rs@mirror.TMC.COM) - 5/3/87
! 		  and Bill Randle (billr@tekred.TEK.COM) - 5/22/87
  */ 
  
  #include <stdio.h>
***************
*** 538,544 ****
          }
        minute = et/60; second = (et - 60*minute);
        if (player == computer) gotoXY(50,18); else gotoXY(50,23);
!       printw("%d:%d",minute,second); ClrEoln();
        if (et > 0) srate = NodeCnt/et; else srate = 0;
        if (post)
          {
--- 538,544 ----
          }
        minute = et/60; second = (et - 60*minute);
        if (player == computer) gotoXY(50,18); else gotoXY(50,23);
!       printw("%d:%02d",minute,second); ClrEoln();
        if (et > 0) srate = NodeCnt/et; else srate = 0;
        if (post)
          {
***************
*** 687,692 ****
--- 687,693 ----
    response_time = buff[0] ? atoi(buff) : DEF_TIME;
    ClrScreen(); PrintBoard(white,0,0,1);
    InitializeStats();
+   time0 = time(0);
    ElapsedTime(1);
    GetOpenings();
  }
***************
*** 853,859 ****
  short piece,i,m0,*aloc,*s;
   
  #ifdef	BSD
!   bzero((char *)a, sizeof a);
  #else
    a = (short *)memset(a,0,64*sizeof(short));
  #endif	/* BSD */
--- 854,860 ----
  short piece,i,m0,*aloc,*s;
   
  #ifdef	BSD
!   bzero((char *)a, 64*sizeof(short));
  #else
    a = (short *)memset(a,0,64*sizeof(short));
  #endif	/* BSD */
-- 

	-Bill Randle
	Tektronix, Inc.
	billr@tekred.TEK.COM
Technical Details
Message-ID: <1238@tekred.TEK.COM>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!husc6!mit-eddie!uw-beaver!tektronix!tekgen!tekred!billr

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!husc6!mit-eddie!uw-beaver!tektronix!tekgen!tekred!billr
From: billr@tekred.TEK.COM (Bill Randle)
Newsgroups: comp.sources.bugs
Subject: Bugfix for Chess game (BSD version)
Message-ID: <1238@tekred.TEK.COM>
Date: Fri, 22-May-87 18:23:12 EDT
Article-I.D.: tekred.1238
Posted: Fri May 22 18:23:12 1987
Date-Received: Sat, 23-May-87 18:40:10 EDT
Reply-To: billr@tekred.TEK.COM (Bill Randle)
Distribution: world
Organization: Tektronix, Inc., Redmond, OR
Lines: 81