gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] 'score' cleanup


From: Arend Bayer
Subject: [gnugo-devel] 'score' cleanup
Date: Sun, 7 Sep 2003 16:24:42 +0200 (CEST)

- remove global variables score, lower_bound, upper_bound
- remove (level >= 8) condition for estimate_score() call
- pass our_score instead of score to the move valuation functions

1. They were only used as local variable, so I think we should treat them
that way. ('score' was also overshadowed by local variable with the same
name in many places.)

2. Even at level 0, estimate score takes only 0.1% of the time, so there
is no point in not calling it (given the many heuristics where we are using
the score).

3. This means a lot of changes such as:

-      else if (!doing_scoring && ((color == BLACK && score < 0.0)
-                                 || (color == WHITE && score > 0.0))) {
+      else if (!doing_scoring && our_score > 0.0) {

Btw, many of the score-dependant heuristics in value_moves.c look a little
odd.

Arend


Index: engine/aftermath.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/aftermath.c,v
retrieving revision 1.44
diff -u -p -r1.44 aftermath.c
--- engine/aftermath.c  24 Aug 2003 03:04:11 -0000      1.44
+++ engine/aftermath.c  6 Sep 2003 19:10:21 -0000
@@ -790,6 +790,8 @@ reduced_genmove(int *move, int color)
 {
   float val;
   int save_verbose;
+  float upper_bound, lower_bound;
+  float our_score;

   /* no move is found yet. */
   *move = NO_MOVE;
@@ -805,29 +807,25 @@ reduced_genmove(int *move, int color)
    * move generation.  If we are ahead, we can play safely and if
    * we are behind, we have to play more daringly.
    */
-  if (level >= 8) {
-    estimate_score(&upper_bound, &lower_bound);
-    if (verbose || showscore) {
-      if (lower_bound == upper_bound)
-       gprintf("\nScore estimate: %s %f\n",
-               lower_bound > 0 ? "W " : "B ", gg_abs(lower_bound));
-      else
-       gprintf("\nScore estimate: %s %f to %s %f\n",
-               lower_bound > 0 ? "W " : "B ", gg_abs(lower_bound),
-               upper_bound > 0 ? "W " : "B ", gg_abs(upper_bound));
-      fflush(stderr);
-    }
-
-    /* The score will be used to determine when we are safely
-     * ahead. So we want the most conservative score.
-     */
-    if (color == WHITE)
-      score = lower_bound;
+  estimate_score(&upper_bound, &lower_bound);
+  if (verbose || showscore) {
+    if (lower_bound == upper_bound)
+      gprintf("\nScore estimate: %s %f\n",
+             lower_bound > 0 ? "W " : "B ", gg_abs(lower_bound));
     else
-      score = upper_bound;
+      gprintf("\nScore estimate: %s %f to %s %f\n",
+             lower_bound > 0 ? "W " : "B ", gg_abs(lower_bound),
+             upper_bound > 0 ? "W " : "B ", gg_abs(upper_bound));
+    fflush(stderr);
   }
+
+  /* The score will be used to determine when we are safely
+   * ahead. So we want the most conservative score.
+   */
+  if (color == WHITE)
+    our_score = lower_bound;
   else
-    score = 0.0;
+    our_score = -upper_bound;

   gg_assert(stackp == 0);

@@ -847,7 +845,7 @@ reduced_genmove(int *move, int color)
   gg_assert(stackp == 0);

   /* Review the move reasons and estimate move values. */
-  if (review_move_reasons(move, &val, color, 0.0, score, NULL))
+  if (review_move_reasons(move, &val, color, 0.0, our_score, NULL))
     TRACE("Move generation likes %1m with value %f\n", *move, val);
   gg_assert(stackp == 0);

Index: engine/genmove.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/genmove.c,v
retrieving revision 1.82
diff -u -p -r1.82 genmove.c
--- engine/genmove.c    8 Aug 2003 15:12:07 -0000       1.82
+++ engine/genmove.c    6 Sep 2003 19:10:23 -0000
@@ -49,11 +49,12 @@ static int initial_influence2_examined =
 static int dragons_refinedly_examined = -1;

 static int revise_semeai(int color);
-static int revise_thrashing_dragon(int color, float advantage);
+static int revise_thrashing_dragon(int color, float our_score,
+                                  float advantage);

 static int find_mirror_move(int *move, int color);
 static int test_symmetry_after_move(int move, int color);
-static int should_resign(int color, float score);
+static int should_resign(int color, float our_score);

 void sgfShowConsideredMoves(void);

@@ -314,6 +315,8 @@ do_genmove(int *move, int color, float p
           int allowed_moves[BOARDMAX])
 {
   float val;
+  float upper_bound, lower_bound;
+  float average_score, our_score;
   int save_verbose;
   int save_depth;

@@ -365,34 +368,34 @@ do_genmove(int *move, int color, float p
    * move generation.  If we are ahead, we can play safely and if
    * we are behind, we have to play more daringly.
    */
-  if (level >= 8) {
-    estimate_score(&upper_bound, &lower_bound);
-    if (verbose || showscore) {
-      if (lower_bound == upper_bound)
-       gprintf("\nScore estimate: %s %f\n",
-               lower_bound > 0 ? "W " : "B ", gg_abs(lower_bound));
-      else
-       gprintf("\nScore estimate: %s %f to %s %f\n",
-               lower_bound > 0 ? "W " : "B ", gg_abs(lower_bound),
-               upper_bound > 0 ? "W " : "B ", gg_abs(upper_bound));
-      fflush(stderr);
-    }
-    time_report(1, "estimate score", NO_MOVE, 1.0);
-    choose_strategy(color, (upper_bound + lower_bound)/2.0,
-                   game_status(color));
-
-    /* The score will be used to determine when we are safely
-     * ahead. So we want the most conservative score.
-     */
-    if (color == WHITE)
-      score = lower_bound;
+  estimate_score(&upper_bound, &lower_bound);
+  if (verbose || showscore) {
+    if (lower_bound == upper_bound)
+      gprintf("\nScore estimate: %s %f\n",
+             lower_bound > 0 ? "W " : "B ", gg_abs(lower_bound));
     else
-      score = upper_bound;
-  }
-  else {
-    score = 0.0;
-    choose_strategy(color, score, 0.0);
-  }
+      gprintf("\nScore estimate: %s %f to %s %f\n",
+             lower_bound > 0 ? "W " : "B ", gg_abs(lower_bound),
+             upper_bound > 0 ? "W " : "B ", gg_abs(upper_bound));
+    fflush(stderr);
+  }
+  time_report(1, "estimate score", NO_MOVE, 1.0);
+  if (color == WHITE)
+    average_score = (upper_bound + lower_bound)/2.0;
+  else
+    average_score = -(upper_bound + lower_bound)/2.0;
+  choose_strategy(color, average_score, game_status(color));
+
+  /* The score will be used to determine when we are safely
+   * ahead. So we want the most conservative score.
+   *
+   * We always want to have the score from our point of view. So
+   * negate it if we are black.
+   */
+  if (color == WHITE)
+    our_score = lower_bound;
+  else
+    our_score = -upper_bound;

   /*
    * Print some of the information if the user wants to.
@@ -446,7 +449,7 @@ do_genmove(int *move, int color, float p

   /* Review the move reasons and estimate move values. */
   if (review_move_reasons(move, &val, color,
-                         pure_threat_value, score, allowed_moves))
+                         pure_threat_value, our_score, allowed_moves))
     TRACE("Move generation likes %1m with value %f\n", *move, val);
   gg_assert(stackp == 0);
   time_report(1, "review move reasons", NO_MOVE, 1.0);
@@ -456,11 +459,11 @@ do_genmove(int *move, int color, float p
    * UNKNOWN. This may generate a move.
    */
   if (val < 10.0 && !doing_scoring && !limit_search) {
-    if (revise_thrashing_dragon(color, 15.0)) {
+    if (revise_thrashing_dragon(color, our_score, 15.0)) {
       shapes(color);
       if (!disable_endgame_patterns)
        endgame_shapes(color);
-      if (review_move_reasons(move, &val, color, pure_threat_value, score,
+      if (review_move_reasons(move, &val, color, pure_threat_value, our_score,
                              allowed_moves)) {
        TRACE("Upon reconsideration move generation likes %1m with value %f\n",
              *move, val);
@@ -474,7 +477,7 @@ do_genmove(int *move, int color, float p
     endgame_shapes(color);
     endgame(color);
     gg_assert(stackp == 0);
-    if (review_move_reasons(move, &val, color, pure_threat_value, score,
+    if (review_move_reasons(move, &val, color, pure_threat_value, our_score,
                            allowed_moves))
       TRACE("Move generation likes %1m with value %f\n", *move, val);
     gg_assert(stackp == 0);
@@ -486,11 +489,11 @@ do_genmove(int *move, int color, float p
    * run shapes and endgame_shapes again. This may turn up a move.
    */
   if (val < 0.0) {
-    if (revise_thrashing_dragon(color, 0.0)
+    if (revise_thrashing_dragon(color, our_score, 0.0)
        || revise_semeai(color)) {
       shapes(color);
       endgame_shapes(color);
-      if (review_move_reasons(move, &val, color, pure_threat_value, score,
+      if (review_move_reasons(move, &val, color, pure_threat_value, our_score,
                              allowed_moves)) {
        TRACE("Upon reconsideration move generation likes %1m with value %f\n",
              *move, val);
@@ -521,9 +524,7 @@ do_genmove(int *move, int color, float p
       && !doing_scoring
       && (play_out_aftermath
          || capture_all_dead
-         || (thrashing_dragon
-             && ((color == BLACK && score < -15.0)
-                 || (color == WHITE && score > 15.0))))
+         || (thrashing_dragon && our_score > 15.0))
       && aftermath_genmove(move, color, NULL, 0) > 0
       && (!allowed_moves || allowed_moves[*move])) {
     ASSERT1(is_legal(*move, color), *move);
@@ -558,7 +559,7 @@ do_genmove(int *move, int color, float p
     TRACE("genmove() recommends %1m with value %f\n", *move, val);
     /* Maybe time to resign...
      */
-    if (resign_allowed && val < 10.0 && should_resign(color, score)) {
+    if (resign_allowed && val < 10.0 && should_resign(color, our_score)) {
       TRACE("... though, genmove() thinks the position is hopeless\n" );
       /* Signal resignation by negating the move value */
       val = -val;
@@ -685,15 +686,14 @@ revise_semeai(int color)
  */

 static int
-revise_thrashing_dragon(int color, float advantage)
+revise_thrashing_dragon(int color, float our_score, float advantage)
 {
   int pos;
   char safe_stones[BOARDMAX];
   float strength[BOARDMAX];

   /* Trust the owl code's opinion if we are behind. */
-  if ((color == BLACK && score > -advantage)
-      || (color == WHITE && score < advantage))
+  if (our_score < advantage)
     return 0;

   if (disable_threat_computation
@@ -778,7 +778,7 @@ test_symmetry_after_move(int move, int c
 /* Helper to decide whether GG should resign a game
  */
 static int
-should_resign(int color, float score)
+should_resign(int color, float our_score)
 {
   float status;
   int d;
@@ -787,9 +787,7 @@ should_resign(int color, float score)
    * behind (of course).
    */
   if (board_size < 19
-      || gg_abs(score) < 45
-      || (color == WHITE && score >= 0.0)
-      || (color == BLACK && score <= 0.0))
+      || our_score > -45.0)
     return 0;
   /* Check dragon statuses. If a friendly dragon is critical, we are
    * possibly not that much behind after we save it. If some hostile
Index: engine/globals.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/globals.c,v
retrieving revision 1.59
diff -u -p -r1.59 globals.c
--- engine/globals.c    12 Aug 2003 03:05:33 -0000      1.59
+++ engine/globals.c    6 Sep 2003 19:10:23 -0000
@@ -90,9 +90,6 @@ int disable_fuseki    = 0;  /* do not ge
 int josekidb          = 1;  /* use fuseki database */
 int showtime          = 0;  /* print time to find move */
 int showscore         = 0;  /* print estimated score */
-float score           = 0.0;
-float lower_bound     = 0.0;
-float upper_bound     = 0.0;
 int level             = DEFAULT_LEVEL; /* strength; up to 10 supported */
 int min_level         = 0;
 int max_level         = gg_max(DEFAULT_LEVEL, 10);
Index: engine/gnugo.h
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/gnugo.h,v
retrieving revision 1.102
diff -u -p -r1.102 gnugo.h
--- engine/gnugo.h      24 Aug 2003 03:04:11 -0000      1.102
+++ engine/gnugo.h      6 Sep 2003 19:10:23 -0000
@@ -221,9 +221,6 @@ extern int level;           /* controls depth of
 extern int semeai_variations;   /* max variations considered reading semeai */
 extern int showtime;           /* print genmove time */
 extern int showscore;          /* print score */
-extern float score;
-extern float lower_bound;
-extern float upper_bound;
 extern int chinese_rules;       /* use chinese (area) rules for counting */
 extern int experimental_owl_ext;     /* use experimental owl (GAIN/LOSS) */
 extern int experimental_semeai;      /* use experimental semeai module */
Index: engine/liberty.h
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/liberty.h,v
retrieving revision 1.201
diff -u -p -r1.201 liberty.h
--- engine/liberty.h    30 Aug 2003 20:38:36 -0000      1.201
+++ engine/liberty.h    6 Sep 2003 19:10:24 -0000
@@ -447,7 +447,7 @@ int atari_atari_blunder_size(int color,
                             const char safe_stones[BOARDMAX]);

 int review_move_reasons(int *move, float *val, int color,
-                       float pure_threat_value, float lower_bound,
+                       float pure_threat_value, float our_score,
                        int allowed_moves[BOARDMAX]);
 int fill_liberty(int *move, int color);
 int aftermath_genmove(int *aftermath_move, int color,
@@ -617,7 +617,7 @@ void clear_break_in_list(void);
 void break_in_move_reasons(int color);

 float estimate_score(float *upper, float *lower);
-void choose_strategy(int color, float score, float game_status);
+void choose_strategy(int color, float our_score, float game_status);

 /* Eye space functions. */
 int is_eye_space(int pos);
Index: engine/persistent.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/persistent.c,v
retrieving revision 1.17
diff -u -p -r1.17 persistent.c
--- engine/persistent.c 10 Aug 2003 17:56:51 -0000      1.17
+++ engine/persistent.c 6 Sep 2003 19:10:25 -0000
@@ -1198,7 +1198,7 @@ store_persistent_breakin_cache(enum rout
   /* If cache is still full, consider kicking out an old entry. */
   if (persistent_breakin_cache_size == MAX_BREAKIN_CACHE_SIZE) {
     int worst_entry = -1;
-    int worst_score = score;
+    int worst_score = tactical_nodes;

     for (k = 1; k < persistent_breakin_cache_size; k++) {
       if (persistent_breakin_cache[k].score < worst_score) {
Index: engine/value_moves.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/value_moves.c,v
retrieving revision 1.108
diff -u -p -r1.108 value_moves.c
--- engine/value_moves.c        12 Aug 2003 03:05:33 -0000      1.108
+++ engine/value_moves.c        6 Sep 2003 19:10:28 -0000
@@ -1346,7 +1346,7 @@ adjacent_to_nondead_stone(int pos, int c
  * Estimate the direct territorial value of a move at (pos).
  */
 static void
-estimate_territorial_value(int pos, int color, float score)
+estimate_territorial_value(int pos, int color, float our_score)
 {
   int other = OTHER_COLOR(color);
   int k;
@@ -1872,25 +1872,16 @@ estimate_territorial_value(int pos, int
              pos, this_value);
        tot_value += this_value * attack_dragon_weight;
       }
-      else if (!doing_scoring && ((color == BLACK && score < 0.0)
-                                 || (color == WHITE && score > 0.0))) {
+      else if (!doing_scoring && our_score > 0.0) {
        /* tm - devalued this bonus (3.1.17) */
        this_value = gg_min(0.9 * dragon[aa].effective_size,
-                           gg_abs(score/2) - board_size/2 - 1);
+                           our_score/2.0 - board_size/2.0 - 1.0);
        this_value = gg_max(this_value, 0);
        TRACE("  %1m: %f - attack %1m, although it seems dead, as we are 
ahead\n",
              pos, this_value, aa);
        tot_value += this_value * attack_dragon_weight;
       }
       else {
-       /* FIXME: Why are we computing a this_value here when it's
-         * never used?
-        */
-       if ((color == BLACK && score > 0.0)
-           || (color == WHITE && score < 0.0))
-         this_value = 0.0;
-       else
-         this_value = gg_min(2*dragon[aa].effective_size, gg_abs(score/2));

        add_reverse_followup_value(pos, 2 * dragon[aa].effective_size);
        if (board[aa] == color)
@@ -2018,7 +2009,7 @@ estimate_territorial_value(int pos, int
  * Estimate the strategical value of a move at (pos).
  */
 static void
-estimate_strategical_value(int pos, int color, float score)
+estimate_strategical_value(int pos, int color, float our_score)
 {
   int k;
   int l;
@@ -2273,9 +2264,8 @@ estimate_strategical_value(int pos, int
          continue;

        /* If we are ahead by more than 20, value connections more strongly */
-       if ((color == WHITE && score > 20.0)
-           || (color == BLACK && score < -20.0))
-         this_value = connection_value(aa, bb, pos, gg_abs(score));
+       if (our_score > 20.0)
+         this_value = connection_value(aa, bb, pos, our_score);
        else
          this_value = connection_value(aa, bb, pos, 0);
        if (this_value > dragon_value[aa]) {
@@ -2286,9 +2276,8 @@ estimate_strategical_value(int pos, int
        }


-       if ((color == WHITE && score > 20.0)
-           || (color == BLACK && score < -20.0))
-         this_value = connection_value(bb, aa, pos, gg_abs(score));
+       if (our_score > 20.0)
+         this_value = connection_value(bb, aa, pos, our_score);
        else
          this_value = connection_value(bb, aa, pos, 0);
        if (this_value > dragon_value[bb]) {
@@ -2432,11 +2421,10 @@ estimate_strategical_value(int pos, int
        /* If we are behind, we should skip this type of move reason.
         * If we are ahead, we should value it more.
         */
-       if ((color == BLACK && score > 0.0)
-           || (color == WHITE && score < 0.0))
+       if (our_score < 0.0)
          this_value = 0.0;
        else
-         this_value = gg_min(2*dragon[aa].effective_size, gg_abs(0.65*score));
+         this_value = gg_min(2*dragon[aa].effective_size, 0.65*our_score);

        if (this_value > dragon_value[aa]) {
          dragon_value[aa] = this_value;
@@ -2546,7 +2534,7 @@ compare_move_reasons(const void *p1, con
  */
 static float
 value_move_reasons(int pos, int color, float pure_threat_value,
-                  float score)
+                  float our_score)
 {
   float tot_value;
   float shape_factor;
@@ -2584,8 +2572,8 @@ value_move_reasons(int pos, int color, f
      * is significant. Territorial value must be computed before
      * strategical value. See connection_value().
      */
-    estimate_territorial_value(pos, color, score);
-    estimate_strategical_value(pos, color, score);
+    estimate_territorial_value(pos, color, our_score);
+    estimate_strategical_value(pos, color, our_score);
   }

   /* Introduction of strategical_weight and territorial_weight,
@@ -2798,7 +2786,7 @@ value_move_reasons(int pos, int color, f
  * Loop over all possible moves and value the move reasons for each.
  */
 static void
-value_moves(int color, float pure_threat_value, float score)
+value_moves(int color, float pure_threat_value, float our_score)
 {
   int m, n;
   int pos;
@@ -2811,7 +2799,7 @@ value_moves(int color, float pure_threat
       pos = POS(m, n);

       move[pos].value = value_move_reasons(pos, color,
-                                          pure_threat_value, score);
+                                          pure_threat_value, our_score);
       if (move[pos].value == 0.0)
        continue;

@@ -3239,7 +3227,7 @@ find_best_move(int *the_move, float *val
  */
 int
 review_move_reasons(int *the_move, float *val, int color,
-                   float pure_threat_value, float score,
+                   float pure_threat_value, float our_score,
                    int allowed_moves[BOARDMAX])
 {
   int save_verbose;
@@ -3271,7 +3259,7 @@ review_move_reasons(int *the_move, float
     list_move_reasons(color);

   /* Evaluate all moves with move reasons. */
-  value_moves(color, pure_threat_value, score);
+  value_moves(color, pure_threat_value, our_score);
   time_report(2, "  value_moves", NO_MOVE, 1.0);

   /* Perform point redistribution */
@@ -3294,7 +3282,7 @@ review_move_reasons(int *the_move, float
  */

 void
-choose_strategy(int color, float score, float game_status)
+choose_strategy(int color, float our_score, float game_status)
 {

   minimum_value_weight  = 1.0;
@@ -3310,9 +3298,7 @@ choose_strategy(int color, float score,

   if (cosmic_gnugo) {

-    if ((game_status > 0.65) &&
-       ((color == BLACK && score < -15.0)
-       || (color == WHITE && score > 15.0))) {
+    if (game_status > 0.65 && our_score > 15.0) {

       /* We seem to be winning, so we use conservative settings */
       minimum_value_weight  = 0.66;
@@ -3337,16 +3323,13 @@ choose_strategy(int color, float score,
       followup_weight       = 0.62;

       /* If we're getting desesperate, try invasions as a last resort */
-      if ((game_status > 0.75)  &&
-          ((color == BLACK && score > 25.0)
-           || (color == WHITE && score < -25.0)))
+      if (game_status > 0.75 && our_score < -25.0)
         invasion_malus_weight = 0.2;

       TRACE("  %s is not winning enough, using aggressive settings.\n",
              color == WHITE ? "White" : "Black");
     }
   }
-
 }


Index: interface/main.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/interface/main.c,v
retrieving revision 1.84
diff -u -p -r1.84 main.c
--- interface/main.c    12 Aug 2003 03:05:33 -0000      1.84
+++ interface/main.c    6 Sep 2003 19:10:30 -0000
@@ -95,6 +95,7 @@ enum {OPT_BOARDSIZE=127,
       OPT_WITH_BREAK_IN,
       OPT_WITHOUT_BREAK_IN,
       OPT_COSMIC_GNUGO,
+      OPT_NO_COSMIC_GNUGO,
       OPT_OPTIONS,
       OPT_STANDARD_SEMEAI,
       OPT_STANDARD_CONNECTIONS,
@@ -241,6 +242,7 @@ static struct gg_option const long_optio
   {"with-break-in",    no_argument, 0, OPT_WITH_BREAK_IN},
   {"without-break-in",  no_argument, 0, OPT_WITHOUT_BREAK_IN},
   {"cosmic-gnugo",   no_argument, 0, OPT_COSMIC_GNUGO},
+  {"no-cosmic-gnugo",   no_argument, 0, OPT_NO_COSMIC_GNUGO},
   {"options",        no_argument, 0, OPT_OPTIONS},
   {"allow-suicide",  no_argument,       0, OPT_ALLOW_SUICIDE},
   {"capture-all-dead",   no_argument,   0, OPT_CAPTURE_ALL_DEAD},
@@ -587,6 +589,10 @@ main(int argc, char *argv[])
        cosmic_gnugo = 1;
        break;

+      case OPT_NO_COSMIC_GNUGO:
+       cosmic_gnugo = 0;
+       break;
+
       case OPT_ALLOW_SUICIDE:
        allow_suicide = 1;
        break;
@@ -1421,6 +1427,7 @@ Experimental options:\n\
    --with-break-in         use the break-in code (on at level 10 by default)\n\
    --without-break-in      do not use the break-in code\n\
    --cosmic-gnugo          use center oriented influence\n\
+   --no-cosmic-gnugo       don't use center oriented influence\n\
    --nofusekidb            turn off fuseki database\n\
    --nofuseki              turn off fuseki moves entirely\n\
    --nojosekidb            turn off joseki database\n\
Index: interface/play_ascii.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/interface/play_ascii.c,v
retrieving revision 1.43
diff -u -p -r1.43 play_ascii.c
--- interface/play_ascii.c      22 Aug 2003 10:49:54 -0000      1.43
+++ interface/play_ascii.c      6 Sep 2003 19:10:31 -0000
@@ -446,6 +446,7 @@ computer_move(Gameinfo *gameinfo, int *p
   int i, j;
   int move_val;
   int resignation_declined = 0;
+  float upper_bound, lower_bound;

   init_sgf(gameinfo);

Index: interface/play_gmp.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/interface/play_gmp.c,v
retrieving revision 1.24
diff -u -p -r1.24 play_gmp.c
--- interface/play_gmp.c        22 Jul 2003 19:50:29 -0000      1.24
+++ interface/play_gmp.c        6 Sep 2003 19:10:32 -0000
@@ -232,9 +232,10 @@ play_gmp(Gameinfo *gameinfo, int simplif
   /* play_gmp() does not return to main(), therefore the score
    * writing code is here.
    */
-  score = gnugo_estimate_score(&upper_bound, &lower_bound);
-
-  sgfWriteResult(sgftree.root, score, 1);
+  {
+    float score = gnugo_estimate_score(NULL, NULL);
+    sgfWriteResult(sgftree.root, score, 1);
+  }
   sgffile_output(&sgftree);

   if (!simplified) {
Index: interface/play_gtp.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/interface/play_gtp.c,v
retrieving revision 1.131
diff -u -p -r1.131 play_gtp.c
--- interface/play_gtp.c        24 Aug 2003 03:04:11 -0000      1.131
+++ interface/play_gtp.c        6 Sep 2003 19:10:34 -0000
@@ -3137,6 +3137,8 @@ static int
 gtp_estimate_score(char *s)
 {
   UNUSED(s);
+  float score;
+  float upper_bound, lower_bound;

   silent_examine_position(WHITE, EXAMINE_DRAGONS);

Index: interface/play_solo.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/interface/play_solo.c,v
retrieving revision 1.28
diff -u -p -r1.28 play_solo.c
--- interface/play_solo.c       18 Jul 2003 18:59:21 -0000      1.28
+++ interface/play_solo.c       6 Sep 2003 19:10:34 -0000
@@ -114,8 +114,10 @@ play_solo(Gameinfo *gameinfo, int moves)
   /* Two passes and it's over. (EMPTY == BOTH) */
   gnugo_who_wins(EMPTY, stdout);

-  score = gnugo_estimate_score(&upper_bound, &lower_bound);
-  sgfWriteResult(sgftree.root, score, 1);
+  {
+    float score = gnugo_estimate_score(NULL, NULL);
+    sgfWriteResult(sgftree.root, score, 1);
+  }
   sgffile_output(&sgftree);

 #if 0
@@ -201,6 +203,7 @@ load_and_score_sgf_file(SGFTree *tree, G
   int next;
   int pass = 0;
   int method;
+  float score;
   SGFTree local_tree;
   SGFTree *score_tree = tree;





reply via email to

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