From 85160b264dc93a302f93210c7985812b41303480 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Fri, 3 Dec 2010 17:51:41 +0100 Subject: [PATCH] 2lib solver: Do not try hopeless escapes --- tactics/2lib.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tactics/2lib.c b/tactics/2lib.c index 563b9cf..5199256 100644 --- a/tactics/2lib.c +++ b/tactics/2lib.c @@ -87,6 +87,17 @@ check_group_atari(struct board *b, group_t group, enum stone owner, if (neighbor_count_at(b, lib, stone_other(owner)) + neighbor_count_at(b, lib, S_OFFBOARD) == 3) continue; + /* XXX: We do not check connecting to a short-on-liberty + * group. */ + + /* If we are the defender, do not escape with moves + * that do not gain liberties anyway since one of the + * "gained" liberties is shared. */ + if (to_play == owner + && neighbor_count_at(b, lib, stone_other(owner)) + neighbor_count_at(b, lib, S_OFFBOARD) == 2 + && coord_is_adjecent(lib, board_group_info(b, group).lib[1 - i], b)) + continue; + #ifdef NO_DOOMED_GROUPS /* If the owner can't play at the spot, we don't want * to bother either. */ -- 2.11.4.GIT