[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gnugo-devel] Computing illegal influence
From: |
Gunnar Farneback |
Subject: |
Re: [gnugo-devel] Computing illegal influence |
Date: |
Mon, 22 Apr 2002 23:00:28 +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) |
Arend wrote:
> This happens at move 263 (the move number is misleading). You can reproduce
> it with
>
> loadsgf game.sgf 261
> genmove_white
> black K2
> genmove_white
>
> The trace output directly before the above message is
> J2: owl attack/defend for E7
> J2: owl attack/defend for F2
>
> This is due to the persistent owl cache entry below.
This patch should solve the problem, but I haven't actually tested it.
In any case this bug shouldn't do any real harm, so it may be better
to save the patch for post 3.2.
- store_persistent_owl_cache() revised
/Gunnar
Index: engine/owl.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/owl.c,v
retrieving revision 1.83
diff -u -r1.83 owl.c
--- engine/owl.c 20 Apr 2002 20:41:53 -0000 1.83
+++ engine/owl.c 22 Apr 2002 20:48:36 -0000
@@ -4792,6 +4792,7 @@
if (ON_BOARD1(move2))
active[move2] = 1;
+ /* Distance four expansion through empty intersections and own stones. */
for (k = 1; k < 5; k++) {
for (pos = BOARDMIN; pos < BOARDMAX; pos++){
if (!ON_BOARD(pos) || board[pos] == other || active[pos] != 0)
@@ -4808,18 +4809,23 @@
}
}
+ /* Adjacent opponent strings. */
for (pos = BOARDMIN; pos < BOARDMAX; pos++) {
if (board[pos] != other || active[pos] != 0)
continue;
for (r = 0; r < 4; r++) {
int pos2 = pos + delta[r];
if (ON_BOARD(pos2) && board[pos2] != other && active[pos2] != 0) {
- active[pos] = 1;
+ mark_string(pos, active, (char) 1);
break;
}
}
}
+ /* Liberties of adjacent opponent strings with less than five liberties +
+ * liberties of low liberty neighbors of adjacent opponent strings
+ * with less than five liberties.
+ */
for (pos = BOARDMIN; pos < BOARDMAX; pos++) {
if (board[pos] == other && active[pos] != 0 && countlib(pos) < 5) {
int libs[4];