# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 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 and 2004 # # 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 2. # # # # 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 for more details. # # # # 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., 59 Temple Place - Suite 330, Boston, MA 02111, # # USA. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # read_defend.db - pattern database for finding tactical defense moves # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # FIXME: Pattern-based reading code is broken. This makes it even more so. attribute_map general ##Pattern RD001 ## ##X* ##Ox ## ##:8,D,value(25) Pattern RD000a X* :8,D,minvalue(0),maxvalue(98) a* ; rgoal[a] == 1 > { > int ostar = olib(*); > int xstar = xlib(*); > if (lib(a) == 2 && xstar > 2 && xstar > ostar) > value = 75; > else if (lib(a) == 2 && xstar > 2) > value = 70; > else if (lib(a) > xstar) > value = 0; > else > value = 50; >} #### #Attack o #### # FIXME: There's a bug in the tree graph implementation that # it requires both O & X anchors. Pattern RD101 Q* :8,D,minvalue(0),maxvalue(65) a* ; lib(a) <= goallib() + 2 ; && (xlib(*) > 1) > { > int ostar = olib(*); > int xstar = xlib(*); > if (lib(a) > 3) > value = 10; > else if (lib(a) == 1) > value = 65; > else if (lib(a) <= 3 && ostar > lib(a) && xstar >= lib(a)) > value = 55; > else > value = 30; > } Pattern RD102 Q.* fall-back to attack :8,D,value(30) ba* ; xlib(a) == 1 && xlib(*) > 1 && lib(b) < 4 Pattern RD104 Q.O* ko attack :8,D,value(7) a.b* ; lib(a) < 4 && lib(b) == 2 && xlib(*) > 1 Pattern RD105 ?OX ko Q*O :8,D,value(31) ?OX Q*a ; lib(a) == 1 && xlib(*) == 1 #### # connect out ### Pattern RD200 Y* connect to friend oX :8,D,value(80) a* oX ; rgoal[a] == 1 ; && xlib(*) > goallib() Pattern RD202 Yo. connect to friend. .*X :8,D,value(70) ad. b*c ; rgoal[a] == 1 ; && lib(c) >= goallib() ; && (!o_somewhere(d) || olib(b) <= 2) Pattern RD204 ?X* protect atari Y.O :8,D,value(66) ?X* abO ; rgoal[a] == 1 ; && olib(b) > 1 ; && lib(a) == 2 #### # protect boundary #### Pattern RD300 QX ?* :8,D,value(50) Qb ?* ; lib(b) == 1 && xlib(*) > 1 Pattern RD302 YO* defend super-string :8,D,minvalue(40),maxvalue(65) Yb* ; lib(b) < 4 && xlib(*) > 1 > if (lib(b) == 2) > value = 65; > else > value = 40; Pattern RD303 Y.O* defend super-string :8,D,value(40) Y.b* ; lib(b) < 4 && xlib(*) > 1 Pattern RD304 Y* superstring liberty :8,D,value(10) a* ; rgoal[a] == 3 && lib(a) <= xlib(*) ######## # special_rescue ######## Pattern RD400 Y.* special_rescue :8,D,value(41) Ya* ; olib(a) <= 2 Pattern RD400a Y. special_rescue ?* :8,D,value(41) Ya ?* ; olib(a) <= 2 #end of file