gnugo-devel
[Top][All Lists]
Advanced

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

Re: [gnugo-devel] more bugfixes


From: Evan Berggren Daniel
Subject: Re: [gnugo-devel] more bugfixes
Date: Sun, 10 Nov 2002 09:17:45 -0500 (EST)

On Sun, 10 Nov 2002, Gunnar Farneback wrote:

> Evan wrote:
> > - findlib() was returning a more liberties than it had copied if liberties
> > > maxlib.  This would cause a crash in some cases (namely, my current work
> > with attack5/defend5.  I can send in the version that has problems if
> > desired).
>
> That is not a bug, it's just a failure to read the documentation.

So it is.  The bug is in the combination code.  Patch below.

Thanks

Evan Daniel

Index: engine/combination.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/combination.c,v
retrieving revision 1.39
diff -u -r1.39 combination.c
--- engine/combination.c        2 Nov 2002 15:33:43 -0000       1.39
+++ engine/combination.c        10 Nov 2002 14:12:34 -0000
@@ -1018,7 +1018,7 @@
   int move;
   int k;
   int liberties;
-  int libs[4];
+  int libs[MAXLIBS];
   int neighbors;
   int adjs[MAXCHAIN];
   int mx[BOARDMAX];
@@ -1047,7 +1047,7 @@
     mx[move] = 1;

     /* Consider all moves to attack a neighbor or to play on a liberty. */
-    liberties = findlib(str, 4, libs);
+    liberties = findlib(str, MAXLIBS, libs);
     for (k = 0; k < liberties; k++) {
       if (!mx[libs[k]]
          && trymove(libs[k], board[str], "aa_defend-A", str,





reply via email to

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