gnugo-devel
[Top][All Lists]
Advanced

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

Re: [gnugo-devel] fast_defense() improvement


From: Gunnar Farnebäck
Subject: Re: [gnugo-devel] fast_defense() improvement
Date: Thu, 17 Jun 2004 02:44:36 +0200
User-agent: EMH/1.14.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.3 Emacs/21.3 (sparc-sun-solaris2.9) MULE/5.0 (SAKAKI)

Arend wrote:
> > So this is what the attached patch does. I have also rewritten the
> 
> And here it actually is.
> [...]
> +  static unsigned liberty_mark = -1;
> +  static unsigned lm[BOARDMAX];
> [...]
> +    if (++liberty_mark == 0)
> +      memset(lm, 0, sizeof(lm));

Unfortunately this code behaves differently the first time around; all
liberties are considered already marked then.

- bugfix in fast_defense()

/Gunnar

Index: engine/reading.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/reading.c,v
retrieving revision 1.149
diff -u -r1.149 reading.c
--- engine/reading.c    8 Jun 2004 03:34:56 -0000       1.149
+++ engine/reading.c    17 Jun 2004 00:43:00 -0000
@@ -1299,8 +1299,10 @@
     /* What is the total number of liberties of the friendly strings around
      * the lunch?
      */
-    if (++liberty_mark == 0)
+    if (++liberty_mark == 0) {
       memset(lm, 0, sizeof(lm));
+      liberty_mark++;
+    }
     /* Loop over all neighbors of the lunch. */
     adj2 = chainlinks(adjs[j], adjs2);
     for (k = 0; k < adj2; k++) {




reply via email to

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