gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] another tactical reading patch


From: Paul Pogonyshev
Subject: [gnugo-devel] another tactical reading patch
Date: Sun, 6 Jun 2004 02:55:16 +0300
User-agent: KMail/1.6.52

One more.

reading:188     PASS 1 A2 [1 A2]
strategy4:151   PASS T5 [T5]

The first one was targeted.  The second pass is lucky and will
need to be "fixed".  However, I think that the first one is more
important.

Nodes counters:

before: 1604650524 2834746 11178248
after:  1604772767 2834527 11178439
            +0.01%  -0.01%   +0.00%

Paul



--- reading.c   02 Jun 2004 23:31:42 +0300      1.145
+++ reading.c   06 Jun 2004 02:45:06 +0300      
@@ -4403,6 +4403,8 @@ break_chain2_moves(int str, struct readi
 
     if (unsafe[0] && unsafe[1]
        && (stackp <= backfill2_depth || have_common_lib(str, apos, NULL))) {
+      int lib;
+
       /* Find backfilling moves. */
       for (k = 0; k < 2; k++) {
        int libs2[3];
@@ -4413,6 +4415,29 @@ break_chain2_moves(int str, struct readi
            ADD_CANDIDATE_MOVE(libs2[1], 0, *moves, "break_chain2-B");
        }
       }
+
+      /* Consider this case (reading:188):
+       *
+       *   |.OOOXXX
+       *   |OXXXOOO
+       *   |.X.O...
+       *   +-------
+       *
+       * We cannot atari the corner X string immediatly, so we need to
+       * backfill.  However, to avoid generating too many variations,
+       * we require that the opponent string is well restrained.
+       * Otherwise it could just run away while we backfill.
+       */
+      if (approxlib(libs[0], other, 3, NULL) <= 2
+         && approxlib(libs[1], other, 3, NULL) <= 2) {
+       if (approxlib(libs[0], color, 1, &lib) == 1
+           && approxlib(lib, color, 3, NULL) >= 3)
+         ADD_CANDIDATE_MOVE(lib, 0, *moves, "break_chain2-C");
+
+       if (approxlib(libs[1], color, 1, &lib) == 1
+           && approxlib(lib, color, 3, NULL) >= 3)
+         ADD_CANDIDATE_MOVE(lib, 0, *moves, "break_chain2-C");
+      }
     }
   }
 }




reply via email to

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