gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] Patch: inge_3_9.2


From: Inge Wallin
Subject: [gnugo-devel] Patch: inge_3_9.2
Date: Mon, 23 Sep 2002 20:58:54 +0200 (MEST)

Here is another small patch that fixes a FIXME.

Summary:
  - comment play_connect_n()
  - document play_connect_n() in the texinfo docs
  - bugfix in play_connect_n (trace output)
  - fix comment in find_double_threats()


================================================================

diff -ur gnugo/doc/utils.texi gnugo.iw/doc/utils.texi
--- gnugo/doc/utils.texi        Tue Apr  9 19:55:53 2002
+++ gnugo.iw/doc/utils.texi     Mon Sep 23 19:47:46 2002
@@ -97,6 +97,19 @@
 set up a crosscut in an autohelper and see whether at least one cutting stone
 can be captured.
 @end quotation
address@hidden @code{int play_connect_n(int color, int do_connect, int 
num_moves, ...)}
address@hidden play_connect_n
address@hidden
+Plays a sequence of moves, alternating between the players and starting
+with color. After having played through the sequence, the two last
+coordinates give two targets that should be connected or disconnected,
+depending on the value of do_connect. If there is no stone present to
+connect or disconnect, it is assumed that the connection has failed. If
+one or more of the moves to play turns out to be illegal for some
+reason, the rest of the sequence is played anyway, and
+connection/disconnection is tested as if nothing special happened.
address@hidden quotation
+
 @item @code{void set_depth_values(int level)}
 @findex set_depth_values
 @quotation
diff -ur gnugo/engine/combination.c gnugo.iw/engine/combination.c
--- gnugo/engine/combination.c  Sat Sep 21 23:02:40 2002
+++ gnugo.iw/engine/combination.c       Mon Sep 23 20:45:34 2002
@@ -113,15 +113,15 @@
     if (!ON_BOARD(ii))
       continue;
 
-    /* Generate ATTACK_EITHER_MOVE move reasons for each pair of the 
+    /* Generate an EITHER_MOVE move reasons for each pair of the 
      * threatened strings.  We must also remove the threats, because
-     * otherwise we would get followup points for them also.     
+     * otherwise we would get followup points for them as well.
      *
      * FIXME: 
      *   - This is perhaps not the best way to do it, but realistically
      *     it will be seldom that more than two strings are threatened
      *     at the same point.  Still, we should find a better way.
-     *   - ATTACK_EITHER_MOVE should be generalized to more than two strings.
+     *   - EITHER_MOVE should be generalized to more than two strings.
      */
     num_a_threatened_groups = get_attack_threats(ii, MAX_THREATENED_STRINGS,
                                                 a_threatened_groups);
diff -ur gnugo/engine/utils.c gnugo.iw/engine/utils.c
--- gnugo/engine/utils.c        Mon Sep 23 19:01:32 2002
+++ gnugo.iw/engine/utils.c     Mon Sep 23 19:47:32 2002
@@ -446,8 +446,15 @@
 }
 
 
-/* FIXME: documentation needs expanding - identical in concept 
- * to play_attack_defend2_n
+/* The function play_connect_n() plays a sequence of moves,
+ * alternating between the players and starting with color. After
+ * having played through the sequence, the two last coordinates
+ * give two targets that should be connected or disconnected, depending on
+ * the value of do_connect. If there is no stone present to connect or
+ * disconnect, it is assumed that the connection has failed. If one or
+ * more of the moves to play turns out to be illegal for some reason,
+ * the rest of the sequence is played anyway, and connection/disconnection
+ * is tested as if nothing special happened.
  */
 
 int 
@@ -469,9 +476,9 @@
     apos = va_arg(ap, int);
 
     if (apos != NO_MOVE
-       && (trymove(apos, mcolor, "play_attack_defend_n", NO_MOVE,
+       && (trymove(apos, mcolor, "play_connect_n", NO_MOVE,
                    EMPTY, NO_MOVE)
-           || tryko(apos, mcolor, "play_attack_defend_n", EMPTY, NO_MOVE)))
+           || tryko(apos, mcolor, "play_connect_n", EMPTY, NO_MOVE)))
       played_moves++;
     mcolor = OTHER_COLOR(mcolor);
   }
@@ -491,6 +498,7 @@
   modify_depth_values(played_moves);
 #endif
   
+  /* See if ypos and zpos can be connected (or disconnected). */
   if (do_connect) {
     if (board[ypos] == EMPTY || board[zpos] == EMPTY)
       success = 0;




reply via email to

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