[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gnugo-devel] reading patch
From: |
Trevor Morris |
Subject: |
Re: [gnugo-devel] reading patch |
Date: |
Fri, 26 Oct 2001 17:02:22 -0400 |
Um, on looking at this again, I do believe that it is correctly a
ko, and not unconditional.
To wit, in reading:154 -
B G4, W F2, B H2, W H3, B H4, W J2, B H1, W J4
A bit complicated, but none-the-less, it is a ko.
-Trevor
At 10:48 PM 10/26/2001 +0200, Gunnar Farneback wrote:
>This patch to reading.c solves the test case reading:154 and as a
>consequence trevor:3. I haven't run the rest of the regressions so I
>don't know whether it has additional effects.
>
>- break_chain2_efficient_moves() and break_chain2_moves() revised
>
>/Gunnar
>
>Index: engine/reading.c
>===================================================================
>RCS file: /cvsroot/gnugo/gnugo/engine/reading.c,v
>retrieving revision 1.26
>diff -u -r1.26 reading.c
>--- engine/reading.c 2001/10/26 07:21:11 1.26
>+++ engine/reading.c 2001/10/26 20:42:33
>@@ -4453,7 +4453,10 @@
> break_chain2_efficient_moves(int str, int moves[MAX_MOVES],
> int scores[MAX_MOVES], int *num_moves)
> {
>+ int color = board[str];
>+ int other = OTHER_COLOR(color);
> int r;
>+ int k;
> int adj, adjs[MAXCHAIN];
> int adj2, adjs2[MAXCHAIN];
> int libs[2];
>@@ -4477,10 +4480,10 @@
> continue;
>
> findlib(adjs[r], 2, libs);
>- if (approxlib(libs[0], board[adjs[r]], 3, NULL) <= 2)
>- ADD_CANDIDATE_MOVE(libs[1], 0, moves, scores, *num_moves);
>- if (approxlib(libs[1], board[adjs[r]], 3, NULL) <= 2)
>- ADD_CANDIDATE_MOVE(libs[0], 0, moves, scores, *num_moves);
>+ for (k = 0; k < 2; k++)
>+ if (approxlib(libs[k], other, 3, NULL) <= 2
>+ && !is_self_atari(libs[1 - k], color))
>+ ADD_CANDIDATE_MOVE(libs[1 - k], 0, moves, scores, *num_moves);
>
> /* A common special case is this kind of edge position
> *
>@@ -4550,6 +4553,7 @@
> for (k = 0; k < 2; k++) {
> unsafe[k] = is_self_atari(libs[k], color);
> if (!unsafe[k]
>+ || is_ko(libs[k], color, NULL)
> || (!require_safe
> && approxlib(libs[k], other, 5, NULL) < 5))
> ADD_CANDIDATE_MOVE(libs[k], 0, moves, scores, *num_moves);
>
>_______________________________________________
>gnugo-devel mailing list
>address@hidden
>http://mail.gnu.org/mailman/listinfo/gnugo-devel
>