gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] no color parameter for examine_position()


From: Arend Bayer
Subject: [gnugo-devel] no color parameter for examine_position()
Date: Tue, 20 Apr 2004 22:59:49 +0200 (CEST)

I thought I had sent this already, but apparently not: 


- remove color parameter from examine_position(), compute_eyes_pessimistic()
- new arrays white_vital_points and black_vital_points
- read_eye() stores vital point in new arrays when add_moves == 1
- new functions find_lunches(), revise_inessentiality(), eye_computations()
  broken out of make_dragons()
- VITAL_EYE_MOVE almost retired

This patch completes the process of complete separation of the first
stage of move generation into 
1. position examination (which is now completely color agnostic) and
2. move reason generation.

It fixes a long-standing bug regarding examine_position(), due to which
a "genmove"-GTP command might have a different result when some command like
"dragon_data" was sent beforehand.

The only remaining offender was
make_dragons()->compute_eyes_pessimistic()->read_eye(), which directly
called add_vital_eye_move(). Instead, it stores the potential moves
in the two new arrays. VITAL_EYE_MOVEs were by now only used as candidates
for further owl attacks, and thus I decided not to generate them at all
any more. Instead find_more_owl_and_attack_moves() generates these moves
ad hoc from the 2 arrays, and VITAL_EYE_MOVE is only used in the
communication between find_more_owl_and_attack_moves() and
do_find_more_owl_and_attack_moves().

When I tried to find a good place where to initialize the arrays, I
decided that this was easier after some clean-up in dragon.c, thus
the (in theory unrelated) big changes to make_dragon(). The function
is still a little too long for my taste.

Arend

Index: engine/aftermath.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/aftermath.c,v
retrieving revision 1.48
diff -u -p -d -r1.48 aftermath.c
--- engine/aftermath.c  12 Apr 2004 15:22:25 -0000      1.48
+++ engine/aftermath.c  19 Apr 2004 03:43:11 -0000
@@ -800,7 +800,7 @@ reduced_genmove(int *move, int color)
   reset_engine();
 
   /* Find out information about the worms and dragons. */
-  examine_position(color, EXAMINE_ALL);
+  examine_position(EXAMINE_ALL);
 
   /* Make a score estimate. This can be used in later stages of the 
    * move generation.  If we are ahead, we can play safely and if
Index: engine/dragon.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/dragon.c,v
retrieving revision 1.134
diff -u -p -d -r1.134 dragon.c
--- engine/dragon.c     10 Apr 2004 14:30:03 -0000      1.134
+++ engine/dragon.c     19 Apr 2004 03:43:14 -0000
@@ -51,6 +51,9 @@
 #include "gg_utils.h"
 
 static void initialize_supplementary_dragon_data(void);
+static void find_lunches(void);
+static void eye_computations(void);
+static void revise_inessentiality(void);
 static void find_neighbor_dragons(void);
 static void add_adjacent_dragons(int a, int b);
 static void add_adjacent_dragon(int a, int b);
@@ -97,7 +100,7 @@ dragon2_func(int pos)
  */
 
 void 
-make_dragons(int color, int stop_before_owl)
+make_dragons(int stop_before_owl)
 {
   int str;
   int d;
@@ -119,87 +122,15 @@ make_dragons(int color, int stop_before_
   initialize_supplementary_dragon_data();
   
   /* Find adjacent worms which can be easily captured: */
-  
-  for (str = BOARDMIN; str < BOARDMAX; str++)
-    if (ON_BOARD(str)) {
-      int food;
-
-      if (worm[str].origin != str
-         || board[str] == EMPTY
-         || worm[str].lunch == NO_MOVE)
-       continue;
-
-      food = worm[str].lunch;
-
-      /* In contrast to worm lunches, a dragon lunch must also be
-       * able to defend itself. 
-       */
-      if (worm[food].defense_codes[0] == 0)
-       continue;
-
-      /* Tell the move generation code about the lunch. */
-      if (IS_STONE(color))
-       add_lunch(str, food);
-       
-      /* If several lunches are found, we pick the juiciest.
-       * First maximize cutstone, then minimize liberties.
-       */
-      {
-       int origin = dragon[str].origin;
-       int lunch = DRAGON2(origin).lunch;
-
-       if (lunch == NO_MOVE
-           || worm[food].cutstone > worm[lunch].cutstone
-           || (worm[food].cutstone == worm[lunch].cutstone
-               && (worm[food].liberties < worm[lunch].liberties))) {
-         DRAGON2(origin).lunch = worm[food].origin;
-         TRACE("at %1m setting %1m.lunch to %1m (cutstone=%d)\n",
-               str, origin,
-               worm[food].origin, worm[food].cutstone);
-       }
-      }
-    }
+  find_lunches();
 
   /* Find topological half eyes and false eyes. */
   find_half_and_false_eyes(BLACK, black_eye, half_eye, NULL);
   find_half_and_false_eyes(WHITE, white_eye, half_eye, NULL);
 
-  /* Compute the number of eyes, half eyes, etc. in an eye space. */
-  for (str = BOARDMIN; str < BOARDMAX; str++) {
-    if (!ON_BOARD(str))
-      continue;
-
-    if (black_eye[str].color == BLACK
-       && black_eye[str].origin == str) {
-      struct eyevalue value;
-      int attack_point, defense_point;
-      
-      compute_eyes(str, &value, &attack_point, &defense_point, 
-                  black_eye, half_eye, 1, color);
-      DEBUG(DEBUG_EYES, "Black eyespace at %1m: %s\n", str,
-           eyevalue_to_string(&value));
-      black_eye[str].value = value;
-      black_eye[str].attack_point = attack_point;
-      black_eye[str].defense_point = defense_point;
-      propagate_eye(str, black_eye);
-    }
-    
-    if (white_eye[str].color == WHITE
-       && white_eye[str].origin == str) {
-      struct eyevalue value;
-      int attack_point, defense_point;
-      
-      compute_eyes(str, &value, &attack_point, &defense_point,
-                  white_eye, half_eye, 1, color);
-      DEBUG(DEBUG_EYES, "White eyespace at %1m: %s\n", str,
-           eyevalue_to_string(&value));
-      white_eye[str].value = value;
-      white_eye[str].attack_point = attack_point;
-      white_eye[str].defense_point = defense_point;
-      propagate_eye(str, white_eye);
-    }
-  }
-
+  /* Compute the number of eyes, half eyes, determine attack/defense points
+   * etc. for all eye spaces. */
+  eye_computations();
   /* Try to determine whether topologically false and half eye points
    * contribute to territory even if the eye doesn't solidify.
    */
@@ -550,6 +481,128 @@ make_dragons(int color, int stop_before_
     if (ON_BOARD(str))
       dragon[str].status = dragon[dragon[str].origin].status;
 
+  /* Revise inessentiality of critical worms and dragons. */
+  revise_inessentiality();
+
+  semeai();
+  time_report(2, "  semeai module", NO_MOVE, 1.0);
+  
+  identify_thrashing_dragons();
+
+  /* Count the non-dead dragons. */
+  lively_white_dragons = 0;
+  lively_black_dragons = 0;
+  for (d = 0; d < number_of_dragons; d++)
+    if (DRAGON(d).crude_status != DEAD) {
+      if (DRAGON(d).color == WHITE)
+        lively_white_dragons++;
+      else
+        lively_black_dragons++;
+    }
+}
+
+
+/* Find capturable worms adjacent to each dragon. */
+static void
+find_lunches()
+{
+  int str;
+  for (str = BOARDMIN; str < BOARDMAX; str++)
+    if (ON_BOARD(str)) {
+      int food;
+
+      if (worm[str].origin != str
+         || board[str] == EMPTY
+         || worm[str].lunch == NO_MOVE)
+       continue;
+
+      food = worm[str].lunch;
+
+      /* In contrast to worm lunches, a dragon lunch must also be
+       * able to defend itself. 
+       */
+      if (worm[food].defense_codes[0] == 0)
+       continue;
+
+      /* Tell the move generation code about the lunch. */
+      add_lunch(str, food);
+       
+      /* If several lunches are found, we pick the juiciest.
+       * First maximize cutstone, then minimize liberties.
+       */
+      {
+       int origin = dragon[str].origin;
+       int lunch = DRAGON2(origin).lunch;
+
+       if (lunch == NO_MOVE
+           || worm[food].cutstone > worm[lunch].cutstone
+           || (worm[food].cutstone == worm[lunch].cutstone
+               && (worm[food].liberties < worm[lunch].liberties))) {
+         DRAGON2(origin).lunch = worm[food].origin;
+         TRACE("at %1m setting %1m.lunch to %1m (cutstone=%d)\n",
+               str, origin,
+               worm[food].origin, worm[food].cutstone);
+       }
+      }
+    }
+}
+
+
+/* Compute the value of each eye space. Store its attack and defense point.
+ * A more comlete list of attack and defense points is stored in the lists
+ * black_vital_points and white_vital_points.
+ */
+static void
+eye_computations()
+{ 
+  int str;
+  memset(black_vital_points, 0, BOARDMAX * sizeof(struct vital_eye_points));
+  memset(white_vital_points, 0, BOARDMAX * sizeof(struct vital_eye_points));
+
+  for (str = BOARDMIN; str < BOARDMAX; str++) {
+    if (!ON_BOARD(str))
+      continue;
+
+    if (black_eye[str].color == BLACK
+       && black_eye[str].origin == str) {
+      struct eyevalue value;
+      int attack_point, defense_point;
+      
+      compute_eyes(str, &value, &attack_point, &defense_point, 
+                  black_eye, half_eye, 1);
+      DEBUG(DEBUG_EYES, "Black eyespace at %1m: %s\n", str,
+           eyevalue_to_string(&value));
+      black_eye[str].value = value;
+      black_eye[str].attack_point = attack_point;
+      black_eye[str].defense_point = defense_point;
+      propagate_eye(str, black_eye);
+    }
+    
+    if (white_eye[str].color == WHITE
+       && white_eye[str].origin == str) {
+      struct eyevalue value;
+      int attack_point, defense_point;
+      
+      compute_eyes(str, &value, &attack_point, &defense_point,
+                  white_eye, half_eye, 1);
+      DEBUG(DEBUG_EYES, "White eyespace at %1m: %s\n", str,
+           eyevalue_to_string(&value));
+      white_eye[str].value = value;
+      white_eye[str].attack_point = attack_point;
+      white_eye[str].defense_point = defense_point;
+      propagate_eye(str, white_eye);
+    }
+  }
+}
+
+
+/* This function revises the inessentiality of critical worms and dragons
+ * according to the criteria explained in the comments below.
+ */
+static void
+revise_inessentiality()
+{
+  int str;
   /* Revise essentiality of critical worms. Specifically, a critical
    * worm which is adjacent to no enemy dragon with status
    * better than DEAD, is considered INESSENTIAL.
@@ -640,24 +693,7 @@ make_dragons(int color, int stop_before_
       }
     }
   }
-
-  semeai();
-  time_report(2, "  semeai module", NO_MOVE, 1.0);
-  
-  identify_thrashing_dragons();
-
-  /* Count the non-dead dragons. */
-  lively_white_dragons = 0;
-  lively_black_dragons = 0;
-  for (d = 0; d < number_of_dragons; d++)
-    if (DRAGON(d).crude_status != DEAD) {
-      if (DRAGON(d).color == WHITE)
-       lively_white_dragons++;
-      else
-       lively_black_dragons++;
-    }
 }
-
 
 /* Initialize the dragon[] array. */
 
Index: engine/genmove.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/genmove.c,v
retrieving revision 1.89
diff -u -p -d -r1.89 genmove.c
--- engine/genmove.c    12 Apr 2004 15:28:22 -0000      1.89
+++ engine/genmove.c    19 Apr 2004 03:43:15 -0000
@@ -107,7 +107,7 @@ reset_engine()
  */
 
 void
-examine_position(int color, int how_much)
+examine_position(int how_much)
 {
   int save_verbose = verbose;
 
@@ -144,14 +144,14 @@ examine_position(int color, int how_much
 
     if (how_much == EXAMINE_DRAGONS_WITHOUT_OWL) {
       if (NEEDS_UPDATE(dragons_examined_without_owl))
-       make_dragons(color, 1);
+       make_dragons(1);
       verbose = save_verbose;
       gg_assert(test_gray_border() < 0);
       return;
     }
     
     if (NEEDS_UPDATE(dragons_examined)) {
-      make_dragons(color, 0);
+      make_dragons(0);
       /* We have automatically done a partial dragon analysis as well. */
       dragons_examined_without_owl = position_number;
     }
@@ -197,7 +197,7 @@ examine_position(int color, int how_much
  * output, and sgf traces are turned off.
  */
 void
-silent_examine_position(int color, int how_much)
+silent_examine_position(int how_much)
 {
   int save_verbose = verbose;
   SGFTree *save_sgf_dumptree = sgf_dumptree;
@@ -211,7 +211,7 @@ silent_examine_position(int color, int h
   debug = 0;
   printmoyo = 0;
   
-  examine_position(color, how_much);
+  examine_position(how_much);
 
   verbose = save_verbose;
   sgf_dumptree = save_sgf_dumptree;
@@ -354,7 +354,7 @@ do_genmove(int *move, int color, float p
 
   /* Find out information about the worms and dragons. */
   start_timer(1);
-  examine_position(color, EXAMINE_ALL);
+  examine_position(EXAMINE_ALL);
   time_report(1, "examine position", NO_MOVE, 1.0);
 
   /* Make a score estimate. This can be used in later stages of the 
Index: engine/globals.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/globals.c,v
retrieving revision 1.61
diff -u -p -d -r1.61 globals.c
--- engine/globals.c    24 Jan 2004 04:04:56 -0000      1.61
+++ engine/globals.c    19 Apr 2004 03:43:15 -0000
@@ -148,11 +148,10 @@ struct dragon_data    dragon[BOARDMAX];
 int                   number_of_dragons;
 struct dragon_data2   *dragon2 = NULL;
 struct half_eye_data  half_eye[BOARDMAX];
-struct half_eye_data  owl_half_eye[BOARDMAX];
 struct eye_data       black_eye[BOARDMAX];
 struct eye_data       white_eye[BOARDMAX];
-struct eye_data       owl_black_eye[BOARDMAX];
-struct eye_data       owl_white_eye[BOARDMAX];
+struct vital_eye_points black_vital_points[BOARDMAX];
+struct vital_eye_points white_vital_points[BOARDMAX];
 struct surround_data  surroundings[MAX_SURROUND];
 int                   surround_pointer;
 
Index: engine/gnugo.h
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/gnugo.h,v
retrieving revision 1.106
diff -u -p -d -r1.106 gnugo.h
--- engine/gnugo.h      11 Feb 2004 12:36:27 -0000      1.106
+++ engine/gnugo.h      19 Apr 2004 03:43:15 -0000
@@ -106,7 +106,6 @@ int  gnugo_find_defense(int m, int n, in
 
 void  gnugo_who_wins(int color, FILE *outfile);
 float gnugo_estimate_score(float *upper, float *lower);
-void  gnugo_examine_position(int color, int how_much);
 
 float gnugo_get_komi(void);
 void  gnugo_get_board(int b[MAX_BOARD][MAX_BOARD]);
@@ -323,8 +322,8 @@ int DEBUG_func(int level, const char *fm
 #define EXAMINE_ALL                 99
 
 void reset_engine(void);
-void examine_position(int color, int how_much);
-void silent_examine_position(int color, int how_much);
+void examine_position(int how_much);
+void silent_examine_position(int how_much);
 
 
 /* ================================================================ */
@@ -362,7 +361,7 @@ void make_worms(void);
 void compute_worm_influence(void);
 
 /* dragon.c */
-void make_dragons(int color, int stop_before_owl);
+void make_dragons(int stop_before_owl);
 void initialize_dragon_data(void);
 void show_dragons(void);
 int crude_status(int pos);
@@ -391,7 +390,7 @@ void decide_owl(int pos);
 void decide_dragon_data(int pos);
 void decide_semeai(int apos, int bpos);
 void decide_tactical_semeai(int apos, int bpos);
-void decide_position(int color);
+void decide_position(void);
 void decide_eye(int pos);
 void decide_combination(int color);
 void decide_surrounded(int pos);
Index: engine/interface.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/interface.c,v
retrieving revision 1.46
diff -u -p -d -r1.46 interface.c
--- engine/interface.c  24 Jan 2004 04:04:56 -0000      1.46
+++ engine/interface.c  19 Apr 2004 03:43:16 -0000
@@ -344,18 +344,10 @@ gnugo_who_wins(int color, FILE *outfile)
 float
 gnugo_estimate_score(float *upper, float *lower)
 {
-  silent_examine_position(WHITE, EXAMINE_DRAGONS);
+  silent_examine_position(EXAMINE_DRAGONS);
   return estimate_score(upper, lower);
 }
 
-
-/* Interface to examine_position(). */
-
-void
-gnugo_examine_position(int color, int how_much)
-{
-  examine_position(color, how_much);
-}
 
 /* Accessor functions for internal board state. */
 
Index: engine/liberty.h
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/liberty.h,v
retrieving revision 1.212
diff -u -p -d -r1.212 liberty.h
--- engine/liberty.h    12 Apr 2004 15:28:22 -0000      1.212
+++ engine/liberty.h    19 Apr 2004 03:43:17 -0000
@@ -951,14 +951,16 @@ struct aftermath_data {
   enum dragon_status final_status[BOARDMAX];
 };
 
+#define MAX_EYE_ATTACKS 3
+
 struct eye_data {
   int color;/* BLACK, WHITE, BLACK_BORDERED, WHITE_BORDERED or GRAY_BORDERED */
   int esize;         /* size of the eyespace                                 */
   int msize;         /* number of marginal vertices                          */
   int origin;        /* The origin                                           */
   struct eyevalue value; /* Number of eyes.                                  */
-  int attack_point;  /* vital point for attack                               */
-  int defense_point; /* vital point for defense                              */
+  int attack_point;  /* vital point for attack */
+  int defense_point; /* vital point for defense        */
 
   /* The above fields are constant on the whole eyespace. */
   /* ---------------------------------------------------------------- */
@@ -971,6 +973,14 @@ struct eye_data {
   char cut;                  /* Opponent can cut at vertex.                */
 };
 
+struct vital_eye_points {
+  int attack_points[MAX_EYE_ATTACKS];
+  int defense_points[MAX_EYE_ATTACKS];
+};
+
+extern struct vital_eye_points black_vital_points[BOARDMAX];
+extern struct vital_eye_points white_vital_points[BOARDMAX];
+
 extern struct eye_data white_eye[BOARDMAX];
 extern struct eye_data black_eye[BOARDMAX];
 
@@ -982,7 +992,7 @@ void compute_eyes(int pos, struct eyeval
                   int *attack_point, int *defense_point,
                   struct eye_data eye[BOARDMAX],
                   struct half_eye_data heye[BOARDMAX],
-                  int add_moves, int color);
+                 int add_moves);
 void compute_eyes_pessimistic(int pos, struct eyevalue *value,
                               int *pessimistic_min,
                               int *attack_point, int *defense_point,
Index: engine/move_reasons.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/move_reasons.c,v
retrieving revision 1.125
diff -u -p -d -r1.125 move_reasons.c
--- engine/move_reasons.c       12 Apr 2004 15:22:29 -0000      1.125
+++ engine/move_reasons.c       19 Apr 2004 03:43:19 -0000
@@ -243,27 +243,6 @@ find_pair_data(int what1, int what2)
   return next_either - 1;
 }
 
-/*
- * Find the index of an eye space in the list of eye spaces.
- * If necessary, add a new entry.
- */
-static int
-find_eye(int eye, int color)
-{
-  int k;
-  ASSERT_ON_BOARD1(eye);
-  
-  for (k = 0; k < next_eye; k++)
-    if (eyes[k] == eye && eyecolor[k] == color)
-      return k;
-  
-  /* Add a new entry. */
-  gg_assert(next_eye < MAX_EYES);
-  eyes[next_eye] = eye;
-  eyecolor[next_eye] = color;
-  next_eye++;
-  return next_eye - 1;
-}
 
 /* Interprets the object of a reason and returns its position.
  * If the object is a pair (of worms or dragons), the position of the first
@@ -288,7 +267,6 @@ get_pos(int reason, int what)
 
   case SEMEAI_MOVE:
   case SEMEAI_THREAT:
-  case VITAL_EYE_MOVE:
   case STRATEGIC_ATTACK_MOVE:
   case STRATEGIC_DEFEND_MOVE:
   case OWL_ATTACK_MOVE:
@@ -893,23 +871,6 @@ add_semeai_threat(int pos, int dr)
 }
 
 /*
- * Add to the reasons for the move at (pos) that it's the vital
- * point for the eye space at (eyespace) of color.
- */
-void
-add_vital_eye_move(int pos, int eyespace, int color)
-{
-  int eye;
-
-  ASSERT_ON_BOARD1(eyespace);
-  if (color == WHITE)
-    eye = find_eye(white_eye[eyespace].origin, color);
-  else
-    eye = find_eye(black_eye[eyespace].origin, color);
-  add_move_reason(pos, VITAL_EYE_MOVE, eye);
-}
-
-/*
  * Add to the reasons for the move at (pos) that it will accomplish
  * one of two things: either (reason1) on (target1) or (reason2) on 
  * (target2).  
@@ -1648,7 +1609,6 @@ list_move_reasons(FILE *out, int move_po
   int bb = NO_MOVE;
   int worm1 = -1;
   int worm2 = -1;
-  int ecolor = 0;
   int num_move_reasons = 0;
 
   gprintf("\nMove reasons:\n");
@@ -1742,17 +1702,6 @@ list_move_reasons(FILE *out, int move_po
          aa = move_reasons[r].what;
          gfprintf(out, "Move at %1m threatens to win semeai for %1m\n",
                   pos, aa);
-         break;
-         
-       case VITAL_EYE_MOVE:
-         aa = eyes[move_reasons[r].what];
-         ecolor = eyecolor[move_reasons[r].what];
-         if (ecolor == WHITE)
-           gfprintf(out, "Move at %1m vital eye point for eye %1m\n",
-                    pos, aa);
-         else
-           gfprintf(out, "Move at %1m vital eye point for eye %1m\n",
-                    pos, aa);
          break;
          
        case EITHER_MOVE:
Index: engine/optics.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/optics.c,v
retrieving revision 1.88
diff -u -p -d -r1.88 optics.c
--- engine/optics.c     14 Apr 2004 23:59:23 -0000      1.88
+++ engine/optics.c     19 Apr 2004 03:43:23 -0000
@@ -58,7 +58,7 @@ static int read_eye(int pos, int *attack
                    struct eyevalue *value,
                    struct eye_data eye[BOARDMAX],
                    struct half_eye_data heye[BOARDMAX],
-                   int add_moves, int color);
+                   int add_moves);
 static int recognize_eye(int pos, int *attack_point, int *defense_point,
                         struct eyevalue *value,
                         struct eye_data eye[BOARDMAX],
@@ -762,8 +762,7 @@ void
 compute_eyes(int pos, struct eyevalue *value,
             int *attack_point, int *defense_point,
             struct eye_data eye[BOARDMAX],
-            struct half_eye_data heye[BOARDMAX],
-            int add_moves, int color)
+            struct half_eye_data heye[BOARDMAX], int add_moves)
 {
   if (attack_point)
     *attack_point = NO_MOVE;
@@ -776,8 +775,7 @@ compute_eyes(int pos, struct eyevalue *v
   }
   
   /* Look up the eye space in the graphs database. */
-  if (read_eye(pos, attack_point, defense_point, value,
-              eye, heye, add_moves, color))
+  if (read_eye(pos, attack_point, defense_point, value, eye, heye, add_moves))
     return;
 
   /* Ideally any eye space that hasn't been matched yet should be two
@@ -875,7 +873,7 @@ compute_eyes_pessimistic(int pos, struct
   
   /* Look up the eye space in the graphs database. */
   if (read_eye(pos, attack_point, defense_point, value,
-              eye, heye, 0, EMPTY)) {
+              eye, heye, 0)) {
     *pessimistic_min = min_eyes(value) - margins;
 
     /* A single point eye which is part of a ko can't be trusted. */
@@ -1063,7 +1061,7 @@ static int
 read_eye(int pos, int *attack_point, int *defense_point,
         struct eyevalue *value, struct eye_data eye[BOARDMAX], 
         struct half_eye_data heye[BOARDMAX], 
-        int add_moves, int color)
+        int add_moves)
 {
   int eye_color;
   int k;
@@ -1209,14 +1207,15 @@ read_eye(int pos, int *attack_point, int
   }
 
   if (add_moves) {
-    if (eye_color == color) {
-      for (k = 0; k < best_vp->num_defenses; k++)
-       add_vital_eye_move(best_vp->defenses[k], pos, eye_color);
-    }
-    else {
-      for (k = 0; k < best_vp->num_attacks; k++)
-       add_vital_eye_move(best_vp->attacks[k], pos, eye_color);
-    }
+    struct vital_eye_points* vital;
+    if (eye_color == WHITE)
+      vital = white_vital_points;
+    else
+      vital = black_vital_points;
+    for (k = 0; k < best_vp->num_defenses && k < MAX_EYE_ATTACKS; k++)
+      vital[pos].defense_points[k] = best_vp->defenses[k];
+    for (k = 0; k < best_vp->num_attacks; k++)
+      vital[pos].attack_points[k] = best_vp->attacks[k];
   }
 
   return 1;
@@ -2348,7 +2347,7 @@ test_eyeshape(int eyesize, int *eye_vert
      * done with help from the owl code. First we must prepare for
      * this though.
      */
-    examine_position(WHITE, EXAMINE_DRAGONS_WITHOUT_OWL);
+    examine_position(EXAMINE_DRAGONS_WITHOUT_OWL);
 
     attack_code = owl_attack(str, &attack_point, NULL, NULL);
 
Index: engine/owl.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/owl.c,v
retrieving revision 1.207
diff -u -p -d -r1.207 owl.c
--- engine/owl.c        18 Apr 2004 20:17:59 -0000      1.207
+++ engine/owl.c        19 Apr 2004 03:43:45 -0000
@@ -1442,7 +1442,7 @@ semeai_propose_eyespace_filling_move(str
          int dummy_defense;
 
          compute_eyes(origin, &new_value, &dummy_attack, &dummy_defense,
-                      owlb->my_eye, owlb->half_eye, 0, owlb->color);
+                      owlb->my_eye, owlb->half_eye, 0);
          if (max_eyes(&new_value) <= 1)
            good_move = 1;
 
Index: engine/sgfdecide.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/sgfdecide.c,v
retrieving revision 1.54
diff -u -p -d -r1.54 sgfdecide.c
--- engine/sgfdecide.c  24 Jan 2004 04:04:56 -0000      1.54
+++ engine/sgfdecide.c  19 Apr 2004 03:43:45 -0000
@@ -211,7 +211,7 @@ decide_owl(int pos)
   /* Prepare pattern matcher and reading code. */
   reset_engine();
 
-  silent_examine_position(board[pos], EXAMINE_DRAGONS_WITHOUT_OWL);
+  silent_examine_position(EXAMINE_DRAGONS_WITHOUT_OWL);
   gprintf("finished examine_position\n");
 
   /* We want to see the reading performed, not just a result picked
@@ -298,7 +298,7 @@ decide_dragon_data(int pos)
     return;
   }
   reset_engine();
-  silent_examine_position(board[pos], FULL_EXAMINE_DRAGONS);
+  silent_examine_position(FULL_EXAMINE_DRAGONS);
 
   gprintf("Dragon at %1m:\n", pos);
   report_dragon(stderr, pos);
@@ -324,7 +324,7 @@ decide_semeai(int apos, int bpos)
   /* Prepare pattern matcher and reading code. */
   reset_engine();
 
-  silent_examine_position(board[apos], EXAMINE_DRAGONS_WITHOUT_OWL);
+  silent_examine_position(EXAMINE_DRAGONS_WITHOUT_OWL);
   gprintf("finished examine_position\n");
   count_variations = 1;
 
@@ -377,7 +377,7 @@ decide_tactical_semeai(int apos, int bpo
   /* Prepare pattern matcher and reading code. */
   reset_engine();
 
-  silent_examine_position(board[apos], EXAMINE_DRAGONS_WITHOUT_OWL);
+  silent_examine_position(EXAMINE_DRAGONS_WITHOUT_OWL);
   gprintf("finished examine_position\n");
   count_variations = 1;
 
@@ -414,7 +414,7 @@ decide_tactical_semeai(int apos, int bpo
  */
 
 void
-decide_position(int color)
+decide_position()
 {
   int pos;
   int move = NO_MOVE;
@@ -426,7 +426,7 @@ decide_position(int color)
   /* Prepare pattern matcher and reading code. */
   reset_engine();
 
-  silent_examine_position(color, EXAMINE_DRAGONS_WITHOUT_OWL);
+  silent_examine_position(EXAMINE_DRAGONS_WITHOUT_OWL);
 
   /* We want to see the reading performed, not just a result picked
    * from the cache. Thus we clear the cache here. */
@@ -525,7 +525,7 @@ decide_eye(int pos)
   SGFTree tree;
 
   reset_engine();
-  silent_examine_position(BLACK, EXAMINE_DRAGONS_WITHOUT_OWL);
+  silent_examine_position(EXAMINE_DRAGONS_WITHOUT_OWL);
   
   color = black_eye[pos].color;
   if (!IS_STONE(color)) {
@@ -544,7 +544,7 @@ decide_eye(int pos)
   if (black_eye[pos].color == BLACK) {
     eyepos = black_eye[pos].origin;
     compute_eyes(eyepos, &value, &attack_point, &defense_point,
-                black_eye, half_eye, 0, EMPTY);
+                black_eye, half_eye, 0);
     gprintf("Black eyespace at %1m: %s\n", eyepos, eyevalue_to_string(&value));
     if (eye_move_urgency(&value) > 0) {
       gprintf("  vital points: %1m (attack) %1m (defense)\n", attack_point,
@@ -555,7 +555,7 @@ decide_eye(int pos)
   if (white_eye[pos].color == WHITE) {
     eyepos = white_eye[pos].origin;
     compute_eyes(eyepos, &value, &attack_point, &defense_point,
-                white_eye, half_eye, 0, EMPTY);
+                white_eye, half_eye, 0);
     gprintf("White eyespace at %1m: %s\n", eyepos, eyevalue_to_string(&value));
     if (eye_move_urgency(&value) > 0) {
       gprintf("  vital points: %1m (attack) %1m (defense)\n", attack_point,
@@ -586,7 +586,7 @@ decide_combination(int color)
   /* Prepare pattern matcher and reading code. */
   reset_engine();
 
-  silent_examine_position(color, EXAMINE_ALL);
+  silent_examine_position(EXAMINE_ALL);
 
   if (*outfilename)
     sgffile_begindump(&tree);
@@ -627,7 +627,7 @@ decide_surrounded(int pos)
   /* Prepare pattern matcher and reading code. */
   reset_engine();
 
-  silent_examine_position(board[pos], EXAMINE_ALL);
+  silent_examine_position(EXAMINE_ALL);
   surround_status = compute_surroundings(pos, NO_MOVE, 1, NULL);
   if (surround_status == 1)
     gprintf("the dragon at %1m is SURROUNDED!\n", pos);
Index: engine/utils.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/utils.c,v
retrieving revision 1.89
diff -u -p -d -r1.89 utils.c
--- engine/utils.c      12 Apr 2004 15:28:22 -0000      1.89
+++ engine/utils.c      19 Apr 2004 03:43:45 -0000
@@ -1810,7 +1810,7 @@ who_wins(int color, FILE *outfile)
 {
   float result;
 
-  silent_examine_position(WHITE, EXAMINE_DRAGONS);
+  silent_examine_position(EXAMINE_DRAGONS);
 
 #if 0
   float white_score;
Index: engine/value_moves.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/value_moves.c,v
retrieving revision 1.121
diff -u -p -d -r1.121 value_moves.c
--- engine/value_moves.c        12 Apr 2004 15:22:44 -0000      1.121
+++ engine/value_moves.c        19 Apr 2004 03:43:45 -0000
@@ -299,22 +299,9 @@ do_find_more_owl_attack_and_defense_move
           || move_reason_type == ATTACK_MOVE_BAD_KO
           || move_reason_type == DEFEND_MOVE
           || move_reason_type == DEFEND_MOVE_GOOD_KO
-          || move_reason_type == DEFEND_MOVE_BAD_KO)
+          || move_reason_type == DEFEND_MOVE_BAD_KO
+          || move_reason_type == VITAL_EYE_MOVE)
     dd1 = what;
-  else if (move_reason_type == VITAL_EYE_MOVE) {
-    int ee = eyes[what];
-    int ecolor = eyecolor[what];
-
-    if (ecolor == WHITE)
-      find_eye_dragons(ee, white_eye, WHITE, &dd1, 1);
-    else
-      find_eye_dragons(ee, black_eye, BLACK, &dd1, 1);
-
-    if (dd1 == NO_MOVE) { /* Maybe we should assert this not to happen. */
-      verbose = save_verbose;
-      return;
-    }
-  }
   else if (move_reason_type == CONNECT_MOVE) {
     int worm1 = conn_worm1[what];
     int worm2 = conn_worm2[what];
@@ -403,6 +390,10 @@ find_more_owl_attack_and_defense_moves(i
   int dd = NO_MOVE;
   int worth_trying;
   int save_verbose;
+  struct eye_data* our_eyes;
+  struct eye_data* your_eyes;
+  struct vital_eye_points * our_vital_points;
+  struct vital_eye_points * your_vital_points;
 
   if (verbose)
     gprintf("\nTrying to upgrade strategical attack and defense moves.\n");
@@ -422,6 +413,50 @@ find_more_owl_attack_and_defense_moves(i
     }
   }
 
+  if (verbose)
+    gprintf("\nTrying vital eye moves as owl attacks.\n");
+  if (color == WHITE) {
+    our_eyes = white_eye;
+    your_eyes = black_eye;
+    our_vital_points = white_vital_points;
+    your_vital_points = black_vital_points;
+  }
+  else {
+    our_eyes = black_eye;
+    your_eyes = white_eye;
+    our_vital_points = black_vital_points;
+    your_vital_points = white_vital_points;
+  }
+
+  for (pos = BOARDMIN; pos < BOARDMAX; pos++) {
+    if (!ON_BOARD(pos))
+      continue;
+    if (our_eyes[pos].origin == pos
+       && our_eyes[pos].defense_point != NO_MOVE) {
+      int k, dr;
+      find_eye_dragons(pos, our_eyes, color, &dr, 1);
+      for (k = 0; k < MAX_EYE_ATTACKS; k++) {
+       int move = our_vital_points[pos].defense_points[k];
+       if (move == NO_MOVE)
+         break;
+       do_find_more_owl_attack_and_defense_moves(color, move,
+                                                 VITAL_EYE_MOVE, dr);
+      }
+    }
+    if (your_eyes[pos].origin == pos
+       && your_eyes[pos].attack_point != NO_MOVE) {
+      int k, dr;
+      find_eye_dragons(pos, your_eyes, OTHER_COLOR(color), &dr, 1);
+      for (k = 0; k < MAX_EYE_ATTACKS; k++) {
+       int move = your_vital_points[pos].attack_points[k];
+       if (move == NO_MOVE)
+         break;
+       do_find_more_owl_attack_and_defense_moves(color, move,
+                                                 VITAL_EYE_MOVE, dr);
+      }
+    }
+  }
+
   save_verbose = verbose;
   if (verbose > 0)
     verbose--;
@@ -1814,13 +1849,6 @@ estimate_territorial_value(int pos, int 
            pos, 2 * dragon[aa].effective_size, aa);
       break;
       
-    case VITAL_EYE_MOVE:
-      /* These are upgraded to owl attacks or defenses in
-       * find_more_owl_attack_and_defense_moves() and should no longer
-       * be counted here.
-       */
-      break;
-       
     case SEMEAI_MOVE:
     case OWL_ATTACK_MOVE:
     case OWL_ATTACK_MOVE_GOOD_KO:
@@ -2413,47 +2441,6 @@ estimate_strategical_value(int pos, int 
 
        break;
        
-      case VITAL_EYE_MOVE:
-#if 0
-       /*
-        * The value of the threatened group itself has already been
-        * accounted for in territorial_value. Now we need to determine
-        * the effect this has on surrounding groups.
-        *
-        * FIXME: Valuation not implemented.
-        */
-       aa = eyes[move_reasons[r].what];
-       ecolor = eyecolor[move_reasons[r].what];
-
-       if (ecolor == WHITE) 
-         bb = white_eye[aa].dragon;
-       else
-         bb = black_eye[aa].dragon;
-
-       if (bb == NO_MOVE) /* Maybe we should assert this not to happen. */
-         break; 
-
-       /* If there is an owl attack/defend move reason for this location,
-        * we don't care about it, since otherwise we would count the
-        * points twice.
-        */
-       if (owl_defense_move_reason_known(pos, bb)
-           || owl_attack_move_reason_known(pos, bb)) {
-         DEBUG(DEBUG_MOVE_REASONS,
-               "    %1m: 0.0 - vital for %1m: owl attack/defense as well\n",
-               pos, bb);
-         break;
-       }
-
-       if (dragon[bb].status == CRITICAL) {
-         this_value = ???
-         TRACE("  %1m: %f - vital for %1m\n",
-               pos, this_value, bb);
-         tot_value += this_value;
-       }
-#endif
-       break;
-
       case STRATEGIC_ATTACK_MOVE:
       case STRATEGIC_DEFEND_MOVE:      
        /* The right way to do this is to estimate the safety of the
Index: interface/main.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/interface/main.c,v
retrieving revision 1.93
diff -u -p -d -r1.93 main.c
--- interface/main.c    27 Feb 2004 21:18:10 -0000      1.93
+++ interface/main.c    19 Apr 2004 03:43:45 -0000
@@ -1267,7 +1267,7 @@ main(int argc, char *argv[])
       color = gameinfo.to_move;
       if (mandated_color != EMPTY)
        color = mandated_color;
-      decide_position(color);
+      decide_position();
     }
     break;
     
Index: interface/play_ascii.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/interface/play_ascii.c,v
retrieving revision 1.46
diff -u -p -d -r1.46 play_ascii.c
--- interface/play_ascii.c      24 Jan 2004 04:04:56 -0000      1.46
+++ interface/play_ascii.c      19 Apr 2004 03:43:45 -0000
@@ -877,7 +877,7 @@ play_ascii(SGFTree *tree, Gameinfo *game
          break;
 
        case CMD_DEAD:
-         examine_position(gameinfo->to_move, FULL_EXAMINE_DRAGONS);
+         examine_position(FULL_EXAMINE_DRAGONS);
          showdead = !showdead;
          break;
 
@@ -894,7 +894,7 @@ play_ascii(SGFTree *tree, Gameinfo *game
        case CMD_SHOWMOYO:
          tmp = printmoyo;
          printmoyo = PRINTMOYO_MOYO;
-         examine_position(gameinfo->to_move, EXAMINE_DRAGONS);
+         examine_position(EXAMINE_DRAGONS);
          print_moyo();
          printmoyo = tmp;
          break;
@@ -902,7 +902,7 @@ play_ascii(SGFTree *tree, Gameinfo *game
        case CMD_SHOWTERRI:
          tmp = printmoyo;
          printmoyo = PRINTMOYO_TERRITORY;
-         examine_position(gameinfo->to_move, EXAMINE_DRAGONS);
+         examine_position(EXAMINE_DRAGONS);
          print_moyo();
          printmoyo = tmp;
          break;
@@ -910,13 +910,13 @@ play_ascii(SGFTree *tree, Gameinfo *game
        case CMD_SHOWAREA:
          tmp = printmoyo;
          printmoyo = PRINTMOYO_AREA;
-         examine_position(gameinfo->to_move, EXAMINE_DRAGONS);
+         examine_position(EXAMINE_DRAGONS);
          print_moyo();
          printmoyo = tmp;
          break;
 
        case CMD_SHOWDRAGONS:
-         examine_position(gameinfo->to_move, EXAMINE_DRAGONS);
+         examine_position(EXAMINE_DRAGONS);
          showboard(1);
          break;
 
@@ -963,7 +963,7 @@ play_ascii(SGFTree *tree, Gameinfo *game
          break;
 
        case CMD_LISTDRAGONS:
-         examine_position(gameinfo->to_move, EXAMINE_DRAGONS);
+         examine_position(EXAMINE_DRAGONS);
          show_dragons();
          break;
 
Index: interface/play_gtp.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/interface/play_gtp.c,v
retrieving revision 1.145
diff -u -p -d -r1.145 play_gtp.c
--- interface/play_gtp.c        12 Apr 2004 15:28:22 -0000      1.145
+++ interface/play_gtp.c        19 Apr 2004 03:43:45 -0000
@@ -1378,7 +1378,7 @@ gtp_owl_attack(char *s)
   if (BOARD(i, j) == EMPTY)
     return gtp_failure("vertex must not be empty");
 
-  silent_examine_position(BOARD(i, j), EXAMINE_DRAGONS_WITHOUT_OWL);
+  silent_examine_position(EXAMINE_DRAGONS_WITHOUT_OWL);
   
   /* to get the variations into the sgf file, clear the reading cache */
   if (sgf_dumptree)
@@ -1417,7 +1417,7 @@ gtp_owl_defend(char *s)
   if (BOARD(i, j) == EMPTY)
     return gtp_failure("vertex must not be empty");
 
-  silent_examine_position(BOARD(i, j), EXAMINE_DRAGONS_WITHOUT_OWL);
+  silent_examine_position(EXAMINE_DRAGONS_WITHOUT_OWL);
   
   /* to get the variations into the sgf file, clear the reading cache */
   if (sgf_dumptree)
@@ -1455,7 +1455,7 @@ gtp_owl_threaten_attack(char *s)
   if (BOARD(i, j) == EMPTY)
     return gtp_failure("vertex must not be empty");
 
-  silent_examine_position(BOARD(i, j), EXAMINE_DRAGONS_WITHOUT_OWL);
+  silent_examine_position(EXAMINE_DRAGONS_WITHOUT_OWL);
   
   /* to get the variations into the sgf file, clear the reading cache */
   if (sgf_dumptree)
@@ -1494,7 +1494,7 @@ gtp_owl_threaten_defense(char *s)
   if (BOARD(i, j) == EMPTY)
     return gtp_failure("vertex must not be empty");
 
-  silent_examine_position(BOARD(i, j), EXAMINE_DRAGONS_WITHOUT_OWL);
+  silent_examine_position(EXAMINE_DRAGONS_WITHOUT_OWL);
   
   /* to get the variations into the sgf file, clear the reading cache */
   if (sgf_dumptree)
@@ -1542,7 +1542,7 @@ gtp_owl_does_attack(char *s)
   if (BOARD(i, j) == EMPTY)
     return gtp_failure("dragon vertex must not be empty");
 
-  silent_examine_position(BOARD(i, j), EXAMINE_DRAGONS_WITHOUT_OWL);
+  silent_examine_position(EXAMINE_DRAGONS_WITHOUT_OWL);
   
   /* to get the variations into the sgf file, clear the reading cache */
   if (sgf_dumptree)
@@ -1583,7 +1583,7 @@ gtp_owl_does_defend(char *s)
   if (BOARD(i, j) == EMPTY)
     return gtp_failure("dragon vertex must not be empty");
 
-  silent_examine_position(BOARD(i, j), EXAMINE_DRAGONS_WITHOUT_OWL);
+  silent_examine_position(EXAMINE_DRAGONS_WITHOUT_OWL);
   
   /* to get the variations into the sgf file, clear the reading cache */
   if (sgf_dumptree)
@@ -1633,7 +1633,7 @@ gtp_owl_connection_defends(char *s)
   if (BOARD(ai, aj) != BOARD(bi, bj))
     return gtp_failure("dragon vertices must have the same color");
 
-  silent_examine_position(BOARD(ai, aj), EXAMINE_DRAGONS_WITHOUT_OWL);
+  silent_examine_position(EXAMINE_DRAGONS_WITHOUT_OWL);
   
   /* to get the variations into the sgf file, clear the reading cache */
   if (sgf_dumptree)
@@ -1701,8 +1701,7 @@ gtp_owl_substantial(char *s)
   if (BOARD(i, j) == EMPTY)
     return gtp_failure("vertex must not be empty");
 
-  silent_examine_position(OTHER_COLOR(BOARD(i, j)),
-                         EXAMINE_DRAGONS_WITHOUT_OWL);
+  silent_examine_position(EXAMINE_DRAGONS_WITHOUT_OWL);
   
   /* to get the variations into the sgf file, clear the reading cache */
   if (sgf_dumptree)
@@ -1740,7 +1739,7 @@ gtp_analyze_semeai(char *s)
   if (BOARD(i, j) == EMPTY)
     return gtp_failure("vertex must not be empty");
 
-  silent_examine_position(BOARD(i, j), EXAMINE_DRAGONS_WITHOUT_OWL);
+  silent_examine_position(EXAMINE_DRAGONS_WITHOUT_OWL);
   /* to get the variations into the sgf file, clear the reading cache */
   if (sgf_dumptree)
     reading_cache_clear();
@@ -1796,7 +1795,7 @@ gtp_analyze_semeai_after_move(char *s)
   if (board[dragonb] == EMPTY)
     return gtp_failure("dragon vertex must not be empty");
 
-  silent_examine_position(board[dragona], EXAMINE_DRAGONS_WITHOUT_OWL);
+  silent_examine_position(EXAMINE_DRAGONS_WITHOUT_OWL);
   /* to get the variations into the sgf file, clear the reading cache */
   if (sgf_dumptree)
     reading_cache_clear();
@@ -1843,7 +1842,7 @@ gtp_tactical_analyze_semeai(char *s)
   if (BOARD(i, j) == EMPTY)
     return gtp_failure("vertex must not be empty");
 
-  silent_examine_position(BOARD(i, j), EXAMINE_DRAGONS_WITHOUT_OWL);
+  silent_examine_position(EXAMINE_DRAGONS_WITHOUT_OWL);
   /* to get the variations into the sgf file, clear the reading cache */
   if (sgf_dumptree)
     reading_cache_clear();
@@ -2061,17 +2060,17 @@ gtp_eval_eye(char *s)
   if (!gtp_decode_coord(s, &m, &n))
     return gtp_failure("invalid coordinate");
 
-  silent_examine_position(BLACK, EXAMINE_DRAGONS_WITHOUT_OWL);
+  silent_examine_position(EXAMINE_DRAGONS_WITHOUT_OWL);
   
   if (black_eye[POS(m, n)].color == BLACK) {
     pos = black_eye[POS(m, n)].origin;
     compute_eyes(pos, &value, &attack_point, &defense_point,
-                black_eye, half_eye, 0, EMPTY);
+                black_eye, half_eye, 0);
   }
   else if (white_eye[POS(m, n)].color == WHITE) {
     pos = white_eye[POS(m, n)].origin;
     compute_eyes(pos, &value, &attack_point, &defense_point,
-                white_eye, half_eye, 0, EMPTY);
+                white_eye, half_eye, 0);
   }
   else
     /* Not an eye or not of unique color. */
@@ -2121,7 +2120,7 @@ gtp_dragon_status(char *s)
   else if (sscanf(s, "%*s") != EOF)
     return gtp_failure("invalid coordinate");
 
-  silent_examine_position(BLACK, EXAMINE_DRAGONS);
+  silent_examine_position(EXAMINE_DRAGONS);
   
   gtp_start_response(GTP_SUCCESS);
 
@@ -2181,7 +2180,7 @@ gtp_same_dragon(char *s)
   if (BOARD(ai, aj) == EMPTY || BOARD(bi, bj) == EMPTY)
     return gtp_failure("vertex must not be empty");
 
-  silent_examine_position(BLACK, EXAMINE_DRAGONS_WITHOUT_OWL);
+  silent_examine_position(EXAMINE_DRAGONS_WITHOUT_OWL);
   
   return gtp_success("%d", dragon[POS(ai, aj)].id == dragon[POS(bi, bj)].id);
 }
@@ -2209,7 +2208,7 @@ gtp_unconditional_status(char *s)
   if (!gtp_decode_coord(s, &i, &j))
     return gtp_failure("invalid coordinate");
 
-  silent_examine_position(BLACK, EXAMINE_WORMS);
+  silent_examine_position(EXAMINE_WORMS);
   
   status = worm[POS(i, j)].unconditional_status;
   if (status == UNKNOWN)
@@ -2240,7 +2239,7 @@ gtp_combination_attack(char *s)
   if (!n)
     return gtp_failure("invalid color");
 
-  silent_examine_position(BLACK, EXAMINE_ALL);
+  silent_examine_position(EXAMINE_ALL);
 
   if (!atari_atari(color, &attack_point, NULL, verbose))
     attack_point = NO_MOVE;
@@ -2271,7 +2270,7 @@ gtp_combination_defend(char *s)
   if (!n)
     return gtp_failure("invalid color");
 
-  silent_examine_position(BLACK, EXAMINE_ALL);
+  silent_examine_position(EXAMINE_ALL);
 
   memset(defense_points, 0, sizeof(defense_points));
   if (!atari_atari(color, NULL, defense_points, verbose))
@@ -3278,7 +3277,7 @@ gtp_estimate_score(char *s)
   float upper_bound, lower_bound;
   UNUSED(s);
 
-  silent_examine_position(WHITE, EXAMINE_DRAGONS);
+  silent_examine_position(EXAMINE_DRAGONS);
   
   score = estimate_score(&upper_bound, &lower_bound);
   gtp_start_response(GTP_SUCCESS);
@@ -3705,7 +3704,7 @@ gtp_initial_influence(char *s)
 
   q = INITIAL_INFLUENCE(color);
   
-  silent_examine_position(color, EXAMINE_ALL);
+  silent_examine_position(EXAMINE_ALL);
 
   return print_influence_data(q, s + n);
 }
@@ -3799,7 +3798,7 @@ gtp_worm_data(char *s)
   if (sscanf(s, "%*c") >= 0 && !gtp_decode_coord(s, &i, &j))
     return gtp_failure("invalid color or coordinate");
 
-  examine_position(EMPTY, EXAMINE_WORMS);
+  examine_position(EXAMINE_WORMS);
 
   gtp_start_response(GTP_SUCCESS);
   
@@ -3907,7 +3906,7 @@ gtp_worm_cutstone(char *s)
   if (BOARD(i, j) == EMPTY)
     return gtp_failure("vertex must not be empty");
 
-  examine_position(EMPTY, EXAMINE_WORMS);
+  examine_position(EXAMINE_WORMS);
 
   return gtp_success(" %d", worm[POS(i, j)].cutstone);
 }
@@ -3930,7 +3929,7 @@ gtp_dragon_data(char *s)
   if (stackp > 0)
     return gtp_failure("dragon data unavailable when stackp > 0");
 
-  examine_position(EMPTY, FULL_EXAMINE_DRAGONS);
+  examine_position(FULL_EXAMINE_DRAGONS);
 
   gtp_start_response(GTP_SUCCESS);
 
@@ -3975,7 +3974,7 @@ gtp_dragon_stones(char *s)
   if (BOARD(i, j) == EMPTY)
     return gtp_failure("dragon_stones called on an empty vertex");
 
-  examine_position(EMPTY, EXAMINE_DRAGONS);
+  examine_position(EXAMINE_DRAGONS);
 
   gtp_start_response(GTP_SUCCESS);
 
@@ -4019,7 +4018,7 @@ gtp_eye_data(char *s)
   if (stackp > 0)
     return gtp_failure("eye data unavailable when stackp > 0");
 
-  examine_position(EMPTY, EXAMINE_DRAGONS_WITHOUT_OWL);
+  examine_position(EXAMINE_DRAGONS_WITHOUT_OWL);
 
   gtp_start_response(GTP_SUCCESS);
 
@@ -4067,7 +4066,7 @@ gtp_half_eye_data(char *s)
   if (stackp > 0)
     return gtp_failure("half eye data unavailable when stackp > 0");
 
-  examine_position(EMPTY, EXAMINE_DRAGONS_WITHOUT_OWL);
+  examine_position(EXAMINE_DRAGONS_WITHOUT_OWL);
 
   gtp_start_response(GTP_SUCCESS);
 
@@ -4385,7 +4384,7 @@ gtp_is_surrounded(char *s)
   if (BOARD(i, j) == EMPTY)
     return gtp_failure("dragon vertex must be nonempty");
 
-  silent_examine_position(BOARD(i, j), EXAMINE_DRAGONS);
+  silent_examine_position(EXAMINE_DRAGONS);
   return gtp_success("%d", DRAGON2(POS(i, j)).surround_status);
 }
 
@@ -4414,7 +4413,7 @@ gtp_does_surround(char *s)
   if (BOARD(di, dj) == EMPTY)
     return gtp_failure("dragon vertex must be nonempty");
 
-  silent_examine_position(BOARD(di, dj), EXAMINE_DRAGONS);
+  silent_examine_position(EXAMINE_DRAGONS);
   return gtp_success("%d", does_surround(POS(si, sj), POS(di, dj)));
 }
 
@@ -4442,7 +4441,7 @@ gtp_surround_map(char *s)
   if (n == 0)
     return gtp_failure("invalid coordinate");
 
-  silent_examine_position(BOARD(di, dj), EXAMINE_DRAGONS);
+  silent_examine_position(EXAMINE_DRAGONS);
   return gtp_success("%d", surround_map(POS(di, dj), POS(mi, mj)));
 }
 
Index: interface/play_solo.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/interface/play_solo.c,v
retrieving revision 1.30
diff -u -p -d -r1.30 play_solo.c
--- interface/play_solo.c       24 Jan 2004 04:04:56 -0000      1.30
+++ interface/play_solo.c       19 Apr 2004 03:43:45 -0000
@@ -270,7 +270,7 @@ load_and_score_sgf_file(SGFTree *tree, G
      * dragon status is computed. Therefore the call to
      * examine_position().
      */
-    examine_position(next, EXAMINE_ALL);
+    examine_position(EXAMINE_ALL);
     score = gnugo_estimate_score(NULL, NULL);
   }
   




reply via email to

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