[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gnugo-devel] owl.c cleaning
From: |
Gunnar Farneback |
Subject: |
Re: [gnugo-devel] owl.c cleaning |
Date: |
Sun, 27 Apr 2003 22:33:01 +0200 |
User-agent: |
EMH/1.14.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.3 Emacs/20.7 (sparc-sun-solaris2.7) (with unibyte mode) |
Paul wrote:
> fixing the bug above had brought a single pass:
>
> owl1:304 PASS 0 [0]
>
> the test must be fixable by improving owl_find_lunches() (that's one
> of the two new FIXMEs), but it doesn't mean we should leave the bug
> there.
Incidentally I already have a fix written for that.
/Gunnar
Index: engine/owl.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/owl.c,v
retrieving revision 1.151
diff -u -r1.151 owl.c
--- engine/owl.c 22 Apr 2003 02:48:05 -0000 1.151
+++ engine/owl.c 27 Apr 2003 20:25:06 -0000
@@ -4316,6 +4316,21 @@
*
* 1b. The liberty is a topologically false eye with respect to the
* goal dragon.
+ *
+ * This is not quite good enough though, as shown in this position:
+ *
+ * ----------
+ * OX.X.OO...
+ * OXX.OOX.O.
+ * O.XXXXX.O.
+ * OOOOOOOOO.
+ *
+ * The four O stones are regarded as inessential after inclusion of
+ * rule 1b, which is clearly inappropriate. To solve this problem we
+ * modify the rule:
+ *
+ * 1b'. The liberty is a topologically false eye with respect to the
+ * goal dragon and is adjacent to no empty vertex.
*/
static void
@@ -4456,6 +4471,17 @@
}
if (diagonal_goal + (off_board >= 2) < 2)
essential = 1;
+ else {
+ /* Check that the liberty is adjacent to no empty
+ * vertex, as required by 1b'.
+ */
+ for (s = 0; s < 4; s++) {
+ if (board[bpos + delta[s]] == EMPTY) {
+ essential = 1;
+ break;
+ }
+ }
+ }
}
if (essential)