gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] Optical patch


From: Daniel Bump
Subject: [gnugo-devel] Optical patch
Date: Thu, 10 Jan 2002 09:19:30 -0800

Trevor wrote:

> On:
> http://www.public32.com/regress/?tstfile=nngs&num=1860&move=D19
> 
> This is an extract of the output from:
> gq -l games/nngs/scf-gnugo-3.1.18-200201060027.sgf -L 117 -t -w -d0x101800
> 
> There's the line:
> Move at D19 vital eye point for dragon PASS (eye D19)
> 
> -Trevor

This is caused by running compute eyes on an eyespace not attached
to any dragon, then generating a move reason. 

I suppose there's never any point to running compute_eyes here,
so I propose the following patch. Alternatively, we could check
that eye.dragon != NO_MOVE before generating the move reason.

Dan

Index: engine/dragon.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/dragon.c,v
retrieving revision 1.44
diff -u -r1.44 dragon.c
--- engine/dragon.c     8 Jan 2002 22:34:14 -0000       1.44
+++ engine/dragon.c     10 Jan 2002 17:15:42 -0000
@@ -282,7 +282,8 @@
       ii = POS(i, j);
 
       if (black_eye[ii].color == BLACK_BORDER
-         && black_eye[ii].origin == ii)
+         && black_eye[ii].origin == ii
+         && black_eye[ii].dragon != NO_MOVE)
       {
        int max, min, attack_point, defense_point;
 
@@ -298,7 +299,8 @@
       }
 
       if (white_eye[ii].color == WHITE_BORDER
-         && white_eye[ii].origin == ii)
+         && white_eye[ii].origin == ii
+         && white_eye[ii].dragon != NO_MOVE)
       {
        int max, min, attack_point, defense_point;
 
Index: engine/optics.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/optics.c,v
retrieving revision 1.34
diff -u -r1.34 optics.c
--- engine/optics.c     19 Dec 2001 20:59:34 -0000      1.34
+++ engine/optics.c     10 Jan 2002 17:15:43 -0000
@@ -1235,7 +1235,8 @@
              struct half_eye_data *this_half_eye = &heye[vpos[map[k]-1]];
 
              for (ix = 0; ix < this_half_eye->num_defends; ix++)
-               defense_points[num_defenses++] = 
this_half_eye->defense_point[ix];
+               defense_points[num_defenses++] 
+                 = this_half_eye->defense_point[ix];
            }
            else
              defense_points[num_defenses++] = vpos[map[k]];







reply via email to

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