From 4364379b786e693710259b20e7cc0c9ab33c1b8b Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Thu, 13 Jan 2011 03:31:23 +0100 Subject: [PATCH] check_group_atari(): If we cannot take liberty due to selfatari, try connecting first --- tactics/2lib.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tactics/2lib.c b/tactics/2lib.c index 0bafbb5..ef1fb73 100644 --- a/tactics/2lib.c +++ b/tactics/2lib.c @@ -115,11 +115,22 @@ can_atari_group(struct board *b, group_t group, enum stone owner, #ifdef NO_DOOMED_GROUPS to_play != owner && #endif - is_bad_selfatari(b, to_play, lib)) - continue; + is_bad_selfatari(b, to_play, lib)) { + /* Okay! But maybe we just need to connect a false + * eye before atari - this is very common in the + * corner. */ + coord_t coord = selfatari_cousin(b, to_play, lib); + if (is_pass(coord)) + continue; + /* Ok, connect, but prefer not to. */ + lib = coord; + preference[i] = false; /* By now, we must be decided we add the move to the - * queue! */ + * queue! [comment intentionally misindented] */ + + } + have[i] = true; /* If the move is too "lumpy", prefer the alternative: -- 2.11.4.GIT