# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# This is GNU Go, a Go program. Contact gnugo@gnu.org, or see #
# http://www.gnu.org/software/gnugo/ for more information. #
# Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, #
# 2008 and 2009 by the Free Software Foundation. #
# This program is free software; you can redistribute it and/or #
# modify it under the terms of the GNU General Public License #
# as published by the Free Software Foundation - version 3, #
# or (at your option) any later version. #
# This program is distributed in the hope that it will be #
# useful, but WITHOUT ANY WARRANTY; without even the implied #
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR #
# PURPOSE. See the GNU General Public License in file COPYING #
# You should have received a copy of the GNU General Public #
# License along with this program; if not, write to the Free #
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, #
# Boston, MA 02111, USA #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# defense.db - pattern database for finding tactical defense moves
# The tactical reading functions try to defend by playing on the
# immediate liberties only. This database is intended to find
# additional defense moves. Notice though that these patterns doesn't
# help the tactical reading to find defense moves later in a move
# sequence but only at stackp=0.
# See patterns.db for a specification of the current database format.
# Since these patterns are matched during make_worms() it doesn't
# make any sense to use classifications such as X and O. No other
# classification than D is useful either since we only have tactical
# The semantics of these patterns are that the move at * is tried
# as a defense for each attackable O string in the pattern.
# The patterns are matched with either player as O.
# FIXME: There are still some redundant patterns.
##################################################################
# Require that the common tesuji at b doesn't invalidate this defense move.
;attack(a) && oplay_defend(*,b,a)
OXXO connect under (the connection may or may not be broken)
|O.o? defend with good eye shape
O.O? Bamboo joint for defense
Ox* defend with eye shape
XXO*. override solid connection
O*.X Draw back to defend connection
?....x jump into empty space
....? jump! (But not down to second line)
XO.. protect by drawing back
o.X? try to defend by clamping to connect
OX* atari on opponent to defend
;lib(a)>1 && lib(b)>1 && lib(C)<=2 && olib(*)>1
# pp New Pattern - see endgame:860 (3.5.1)
OOOO* a very specific position (defend the stone on the first line)