# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# 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 #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Further documentation may be found in the Texinfo documentation
# First there is a pattern title of the form: Pattern [string]. The
# string is used for identifying the pattern while tuning or debugging.
# Then a block of the following characters representing the pattern
# x : your piece or empty
# If a pattern must not match at the edge of the board,
# an extra row of ?'s in the pattern may be added. (This
# will not add to the time taken to check the pattern.)
# After the pattern, some supplementary information in the format:
# :trfno, classification, [values], helper_function
# These and other aspects of the pattern database are documented
# in the Texinfo documentation.
# Any line beginning with #, or any part of a line following
# whitespace is a comment.
# The patterns are classified into a number of different categories:
# CC center cut/connection
# CD center defend/attack
# CM center miscellaneous
# (F fuseki) moved to fuseki.db
# (J joseki) moved to fuseki.db
# The patterns are grouped in the file by category. New patterns
# should be added close to a similar pattern or at the end of the
# category where it belongs. When a new pattern is added, the names
# of later patterns in the category should usually not be changed.
# This can be accomplished by introducing names like CC35b and so on.
# FIXME: try to make callback_data pattern category specific
##########################
# Cutting and Connecting patterns
# Mainly patterns which actually guarantee a cut or a connection are
# accepted. Occasionally patterns which threaten to make a cut or
# connection. These patterns are given the C or B classification.
# See ConnXXX and CutXXX for a new set of cutting and connecting patterns.
##########################
# Center Cuts and Connections
##########################
?.X connect against peep (not on edge)
;xplay_attack_either(*,a,a,b) || xplay_attack(*,a,c)
# More accurate helper needed.
;lib(a)>1 && (alive(a) || alive(b))
?xxx? straight extension to connect
;xcut(a) && odefend_against(*,a)
;!xplay_attack(*,A) && !xplay_attack(*,B)
o.X separate the opponent
;!attack(A) && !attack(B)
;(alive(a) || alive(c)) && oplay_defend(*,B,c);
# gf Added n classification. (3.3.16)
# gf Revised constraint. (3.5.4)
;lib(c)>1 && oplay_attack_either(*,A,B)
# gf New pattern. (3.5.3)
# This connection is bad shape. Should have a helper to verify
;&& (!oplay_attack_either(*,a,b,b,c) || !oplay_attack_either(*,b,a,*,a))
;&& (!oplay_attack_either(*,a,b,b,c) || !oplay_attack_either(*,b,a,*,a))
;&& (!oplay_attack_either(*,a,b,b,c) || !oplay_attack_either(*,b,a,*,a))
;!omoyo(c) || !omoyo(d) || !xplay_attack(a,*,b,b)
;oplay_attack(*,a,a) == WIN
# gf Revised pattern. (3.3.16)
# gf Revised pattern. (3.3.16)
;oplay_defend_both(*,a,b,*,b) && oplay_defend_both(*,b,a,*,a)
XO.? hane to break connection
;!oplay_attack(*,a,b,*) && !oplay_attack(*,a,b,b)
;lib(a)>1 && oplay_attack(*,b,c,d,d)
;lib(a)>1 && oplay_attack(*,b,c,d,d)
;lib(a)>1 && oplay_attack(*,b,c,d,d)
# This pattern guarantees a strong connection.
# The constraint is asymmetric.
;&& (!oplay_defend(*,D) || oplay_attack_either(*,a,b,c,D,c))
?O*x Connect on the right side
?XX? Cut or threaten to cut
# This pattern caused a problem at move 52 in ego.sgf
;oplay_defend_both(*,a,*,b)
O.X boldly cut before connecting
;oplay_attack(*,a,a) || oplay_attack(*,a,d)
;|| (oplay_attack(*,a,c) && !oplay_attack(*,a,b))
# B classification is somewhat incorrect, but does convey the urgency
;lib(A)>1 && lib(b)>1 && alive(c)
;oplay_attack(*,a,a) && !oplay_attack(*,b,a,c)
.*.X separate the opponent
;!oplay_attack(*,a,b,c,d) && !oplay_attack(*,a,b,c,*)
;oplay_attack_either(*,a,a,B)
;!xarea(d) && !oplay_attack_either(*,a,b,*,b)
;&& !oplay_attack_either(*,b,a,c,d,a,d)
;(!xarea(f) || !(xarea(e) && xarea(g)))
;&& !oplay_attack_either(*,a,b,c,d,d,b)
;&& !oplay_attack_either(*,a,b,d,c,c,b)
# Constraint probably needs revision.
;oplay_attack(*,a,b,d) && oplay_attack(*,a,b,a)
;&& oplay_attack(*,a,b,e,e) && oplay_attack(*,a,b,c,c)
# ab New pattern. (3.3.10)
.OX.? keep loose connection
;!same_dragon(a,b) && (alive(a) || alive(b))
;alive(c) && oplay_defend_both(*,a,*,b)
# This is a very conservative estimate of the chances to connect.
# Other patterns are more accurate.
# We really would need tactical reading functions for determining
# whether a connection holds.
;!oplay_defend(*,a,b,c,a) && !oplay_defend(*,a,b,c,c)
# Analogous to the previous one.
;!xplay_break_through(*,A,*,B)
# gf Removed obsolete add_connect_move actions. (3.3.16)
??XO? connect three stones
;lib(a)>2 && lib(b)>2 && lib(c)>3
?X?? cut the knight's move
?X?? cut the knight's move
..Xx separate the opponent
..X. Attach to defend connection
;!oplay_attack_either(*,a,b,*,b) && oplay_defend_both(*,b,a,c,a,d)
;!oplay_attack_either(*,a,b,*,b) && oplay_defend_both(*,b,a,c,a,d)
;(alive(f) || alive(g)) && !oplay_defend_both(*,a,b,c,d,c,E)
# This connection is a bit sloppy but if we can't connect
# we do at least capture an opponent worm. Assume we are allowed
# to connect if the worm is at least as large as our dragon.
;!oplay_defend_both(*,a,b,c,d,c,E) && (dragonsize(f) <= wormsize(E))
# gf Reduced shape value. (3.5.2)
# gf Split pattern. (3.1.7)
.O*. connect and constrain X
; oplay_attack(*,a,a) && oplay_attack(*,b,b)
# gf Split pattern. (3.1.7)
# Only shape bonus if X stones can't be attacked.
.O*. connect and constrain X
;oplay_attack(*,a,a) && oplay_attack(*,b,b)
;&& !(attack(C) && oplay_defend(*,C))
# tm: reduced shape value from 8 to 3 (3.1.18)
; !same_dragon(C,D) && xplay_attack_either(*,a,a,b)
;lib(a)>1 && xplay_attack(b,b)==3
# gf Reduced shape value. (3.5.2)
..?? reverse sente connection
; !dead(A) && (xplay_attack(*,B) || xplay_attack(*,A))
# gf New pattern. (3.1.23)
;!oplay_defend(*,a,b,a) && oplay_attack(*,b,a,c,c)
XO?? prevent double nozoki
##########################
# General Edge Connections
##########################
# gf Removed obsolete add_connect_move actions. (3.3.16)
;&& !oplay_defend_both(*,a,b,a,E)
;&& oplay_attack_either(*,b,a,c,b,c)
# gf Removed obsolete add_connect_move actions. (3.3.16)
;odefend_against(*,d) && !oplay_attack(*,a,b,e)
;odefend_against(*,a) || !oplay_attack_either(*,a,b,c,d)
;xdefend_against(*,a) || !xplay_attack_either(*,a,b,C,D)
;odefend_against(*,a) && !oplay_attack(*,b,c,d,e,e)
;!xplay_defend_both(*,a,b,a,D) && xplay_attack_either(*,b,a,c,b,c)
# gf Revised constraint. (3.5.3)
;oplay_disconnect(a,b) && !oplay_disconnect(*,a,b)
; x_alive_somewhere(a,b,c,d)
XO? separate the opponent
# gf Reduced shape value. (3.5.2)
?..O? hanging connection is best
OO? Get up from first line.
.X? Try to prevent connection
;!xplay_break_through(*,a,*,b)
;!xplay_break_through(*,a,*,b)
# This move does not secure a connection without a constraint, see
;!xplay_defend_both(*,a,b,a,e)
;&& xplay_attack_either(*,b,a,d,d,b)
;&& oplay_attack_either(*,b,b,c)
;&& oplay_attack_either(*,a,d,b,b,c)
# Smaller endgame profit than EC25.
;(!xplay_defend(a,b,*,b) || !xplay_defend(a,b,*,d))
;&& xplay_attack(a,*,b,c,c)
# gf Removed obsolete add_connect_move action. (3.3.16)
# gf Reduced shape value. (3.5.2)
?X*O Use edge to stay connected.
; !attack(B) && oplay_attack(*,a,a)
# gf Removed obsolete add_connect_move action. (3.3.16)
;!oplay_attack(*,a,b,c) && !oplay_attack(*,b,a,c)
;oplay_attack_either(*,a,B,a)
?..?? Clamp to connect under
Oo.X stop connection on edge
X.OX block edge connection
;!oplay_attack(*,a,b,c,d,e)
# gf The constraint was too inexact, see match at B9 in score2:34.
# Replaced it by a connection constraint. (3.1.32)
X*O? Prevent opponent's connection under
;oplay_connect(A,B) && !oplay_connect(*,A,B)
??O?? Connect underneath by attaching
;oplay_attack_either(*,a,b,c,a,c) && oplay_attack_either(*,d,e,f,d,f)
;&& !oplay_defend_both(*,b,a,d,e,b,d)
;&& !oplay_defend_both(*,e,d,a,b,e,a)
;!oplay_defend_both(*,b,a,b,I) && oplay_attack_either(*,a,b,c,a,c)
;&& oplay_attack_either(*,b,a,d,e,f,g,h,f,h)
;&& !oplay_defend_both(*,b,a,d,e,g,f,g,I)
.XO.X hane to prevent connection
# tm added constraint (3.1.18)
# gf Changed B classification to C. (3.1.18)
; xplay_attack(A,B,c) || xplay_attack(*,c)
# tm New Pattern (3.1.18)
# gf Changed B classification to C. (3.1.18)
?O.. indirectly protect cut
; oplay_defend_both(*,a,*,b)
.X.?? defend the extension
# gf Fixed value removed and constraint revised. (3.5.2)
?X? connect underneath if X can't cut
;!oplay_disconnect(*,a,b)
# gf Removed fixed value. (3.5.2)
..xxx threaten connection
# gf Reduced shape value. (3.5.2)
# gf Reduced shape value. (3.5.2)
; oplay_attack(*,a,a) && oplay_attack(*,b,b)
# gf Reduced shape value. (3.5.2)
; oplay_attack(*,a,a)&&oplay_attack(*,b,b)
; lib(A)<4 && lib(b)>2 && !attack(A)
# constraint looks for shortage of liberties
; !oplay_attack(*,a,b,c,d,*,c)
# constraint looks for shortage of liberties
xXO.X prevent ko connection
; !xplay_attack(*,a,b,c,d,*,c)
#gf New pattern. (3.1.12)
;alive(b) && oplay_attack(*,a,a)
;oplay_defend(*,A) != WIN
# gf Revised constraint. (3.3.12)
#FIXME: There's still a problem here, in that this sacrifice
# is deemed unsafe, and not played....
# gf Is this really a cut pattern? (3.3.13)
OOO block or cut into black's territory.
; || !oplay_attack(*,a,b,b)
# gf New Pattern (3.3.13)
# gf New Pattern (3.3.15)
XOOX block edge connection
# gf New Pattern (3.3.16)
XXX.Ox connect all stones
##############################################
# First line, one space, cuts and connections.
##############################################
;xdefend_against(*,a) && xdefend_against(*,b)
;xdefend_against(b,a) && xdefend_against(b,*) && !oplay_attack(*,c)
;odefend_against(*,a) && odefend_against(*,b)
XO? don't allow connection underneath
;(safe_xmove(*) && xplay_defend_both(*,a,*,B)) || xdefend_against(a,*)
XO? don't allow connection underneath
XOX block edge connection
;(!attack(A)) && (!attack(B))
##############################################
# First line, two spaces, cuts and connections.
##############################################
XO.. don't allow connection underneath
;safe_xmove(*) && xplay_defend_both(*,a,*,B)
XO*. don't allow connection underneath
;xplay_defend_both(c,a,c,B)
XO.. don't allow connection underneath
XO*. don't allow connection underneath
XO.O don't allow connection underneath
;odefend_against(*,a) && oplay_defend(*,b,*)
?XO.OX? prevent connection
;oplay_attack_either(*,c,E,c) && oplay_attack_either(*,b,a,d,b,d)
;&& oplay_attack(*,a,b,c,E) == WIN
X.OX block edge connection
;xdefend_against(*,a) && !xplay_attack(*,B)
;xplay_attack_either(*,c,e,c) && xplay_attack_either(*,b,a,d,b,d)
;&& xplay_attack(*,a,b,c,e)
X.OO block edge connection
?xx.. Defend inverse monkey jump
??OO? Cut through monkey jump.
?X..O Monkey jump edge connection
;lib(B)>1 && lib(C)>1 && xplay_attack(*,a,a)
######################################################################
# Splitting and other strategically attacking (or defending) moves
# These patterns do not have the C or B classification but they
# often have an effect on connections.
######################################################################
####################################
# Center splitting patterns
####################################
?X?X? pattern to make two partial connections
...X Move out and separate
.X.O.?? pattern to separate the opponent
??x?? Play out to separate the opponent
??O.? Play out to separate the opponent. Only play if no risk for cut at a below.
??.?? jump to separate opponent
..X Cut across large knight's move
??.?? jump to separate opponent
# gf Revised constraint. (3.5.3)
;!same_dragon(A,B) && (weak(c) || xplay_connect(*,d,A,B))
xXx Even a computer answers a peep.
;xplay_break_through(*,a,b,a,c)
# gf Corrected symmetry. (3.1.23)
# gf Corrected symmetry. (3.1.23)
# gf Split pattern. (3.3.16)
# gf Corrected symmetry. (3.1.23)
# gf Split pattern. (3.3.16)
?..?? when caught in a crosscut, extend
# This is part of a standard sequence in 4 stone games
####################################
# Edge splitting patterns
####################################
# gf New pattern. (3.5.3)
....X invade with support from above
# gf New pattern. (3.5.3)
....X invade with support from above
;!weak(a) && oplay_connect(*,b,*,a)
######################################################################
# Edge block/expand patterns
# Moves that expand own position along the edge in some way or stops
# opponent from expanding his position. This includes monkey jump,
# various sliding moves, blocks, some extensions along the edge. This
# category contains very many patterns and may need to be split sooner
# or later. Some extensions along the edge can be found in the fuseki
# These patterns are further subdivided into the following classes:
# Third and fourth line blocks
# Monkey jump and other intrusions on first and second lines
# Third line push or extend
# Second line push or extend
# Block intrusion from above
######################################################################
# gf Constraint added. See gunnar:86. (3.7.10)
;!oplay_disconnect(*,a,b,*,c)
...?? slide toward opponent's position
# tm added d class (3.1.20)
# tm added d class (3.1.20)
# tm added d class (3.1.20)
?.X.o jump under a stone on 4-th row
..... knight's move for defense
......? knight's move for defense
.X.. knight's move to come out
# if EB110 does not defend, this one may
..... jump when stone on third row is approached
....?? knight's move to come out
.... match opponent's jump
......? push up to expand
??????x?? high approach deemed bad
??????x?? far high approach deemed bad
...... defend to prevent peep
....xx jump toward opponent's position
# gf Don't attach a weak stone. (3.1.18)
.O.. diagonal attachment on 3-rd line
?X.O? double sente kosumi
?o?? extend towards opponent
XOO... prevent opponent's slide
...oo block extension if X is weak
:8,Oe,jump_out_far_helper
:8,Oe,jump_out_far_helper
:8,Oe,jump_out_far_helper
;oplay_attack(*,a,b,c,c) && x_alive_somewhere(d,e)
# gf Added constraint. (3.5.3)
;!oplay_disconnect(*,*,a)
# gf Reduced shape value. (3.5.2)
; o_alive_somewhere(a,b,c,d)
# gf Added OX classification. (3.3.3)
##############################
# Third and fourth line blocks
##############################
# gf Reduced shape value. (3.5.2)
# gf Reduced shape value. (3.5.2)
?..X.? push in to stabilize
??.?? hane on the 4-th line
??.?? hane on the 4-th line
;oplay_attack_either(*,a,a,B)
# tm Reduced shape value from 4 to 3 (3.1.20)
# gf Removed shape value. (3.3.16)
# tm New Pattern (3.1.20) (see strategy:26)
# gf Reduced shape value. (3.5.2)
# gf FIXME: This pattern seems to need more context or a constraint. (3.3.12)
..O. Block opponent's extension on third line
?... block to prevent incursion
.O.O blocking is very large
..*X attach to immobilize 1-st line stone
?O.? connect against peep (third line)
?OO?? jump down and block
# gf FIXED: This fixed value looks dangerous. (3.3.12)
# gf Removed fixed value and E classification. (3.5.2)
; attack(a) && !defend(a)
?Oo? block on second line
?Oo? block on second line
?.O block on second line if safe from cut and clamp
;oplay_attack_either(*,a,a,D)
;&& (oplay_attack(*,b,D) || oplay_attack_either(*,b,c,a,a,D))
?.O block on second line if safe from cut
?.O block on second line if safe from cut
?OOO block on second line
OOXX block on second line
;odefend_against(*,a) || omoyo(b)
.O? Prevent monkey jump or other incursion
# gf New pattern. (3.3.13)
.O? Prevent monkey jump or other incursion
# gf Revised pattern. (3.1.9)
oO.? Prevent monkey jump or other incursion
oO.? Prevent monkey jump or other incursion
oO.? Prevent monkey jump or other incursion
# gf Unified with EB625. (3.3.12)
;lib(a)>1 && !oplay_disconnect(*,*,b)
X?O?? block after attachment
..?? don't let the opponent undermine
# gf Revised pattern. (3.3.12)
;!oplay_disconnect(*,*,a)
...Oo? Fend off territory (hopefully)
?OOOX? Stop eye-stealing move
?o.? stop intrusion on first line
;!oplay_attack_either(*,a,b,*,b) && oplay_attack_either(*,a,b,c,d,e,a,e)
;!oplay_attack_either(*,a,b,*,b)
;!oplay_attack_either(*,a,b,*,b)
;!oplay_attack_either(*,a,b,*,b)
:8,OXe,reverse_followup(6)
# gf New pattern. (3.5.3)
|.OX Descending in the corner for profit and eyespace
# tm modified (3.1.20) (see endgame:102)
:8,OXe,reverse_followup(6)
;|| !oplay_attack_either(*,b,c,*,a)
:8,OXe,reverse_followup(2.5)
# gf Added O classification. (3.1.32)
?oO block on edge. Sometimes better to fall back...
# FIXME: (see trevorc:1040)
;xplay_attack(*,a,a) || weak(b)
??Oo??? prevent incursion with sente
|..? prevent incursion with sente
|.XO extending in the corner is huge: double sente
:8,OXe,reverse_followup(3)
# gf New pattern. (3.1.14)
|*XO if this move can't be captured and O is already alive, we prefer
:8,OXe,reverse_followup(3)
# gf Removed fixed value. (3.5.2)
;oplay_attack(*,A) && !oplay_attack(*,b)
# Probably bigger reverse followup in reality
:8,OXe,reverse_followup(6)
; !xplay_attack_either(*,a,b,*,b)
# gf New pattern. (3.7.10)
# Probably bigger reverse followup in reality
# See trevora:340 and trevorb:370.
:8,Xe,reverse_followup(6)
;alive(d) && !xplay_attack_either(c,a,b,c,b) && oplay_attack(*,c,c)
;&& !oplay_connect(c,*,d,e)
# FIXME: (see trevorc:1040)
:8,OXe,reverse_followup(3)
;!xplay_attack_either(*,a,b,*,b)
O.* jump if blocking is impossible
;!oplay_defend_both(b,c,a,b) && !oplay_defend_both(c,b,d,*,c,d)
O*. pull back if blocking is impossible
;!oplay_defend_both(b,*,a,b) && oplay_defend_both(*,b,d,c,a,d)
# tm New Pattern (3.1.18)
# gf FIXME: lib(A)==2 is always true in this pattern. (3.1.23)
; && !oplay_attack_either(*,B,*)
# tm New Pattern (3.1.20)
# compare to EB715 - slightly different.
;!oplay_defend_both(b,c,a,b) && oplay_defend_both(*,c,a,*)
# gf New pattern. (3.5.3)
# Inexact followup but usually big.
;alive(d) && critical(e) && !oplay_defend_both(*,?,a,B,C)
############################################################
# Monkey jump and other intrusions on first and second lines
############################################################
O.X.? jump under on second line
# gf Revised pattern and constraint. (3.3.12)
;!weak(a) && o_alive_somewhere(b,c,d) && x_alive_somewhere(E,F,G)
;&& !oplay_disconnect(*,*,a)
?xX.. inverse monkey jump
?Xx.. inverse monkey jump
# tm added defend_against_atari
?xxx? jump out on first line
;!weak(a) && oplay_attack(*,b,b)
###########################
# Third line push or extend
###########################
?????X.? defense is becoming urgent
?.X.. follow up the slide with diagonal move (another slide could be broken)
X.XX.. extend to 3 since B hane would be severe.
?XX? extend to defend slide
# gf Unified with EB916. (3.3.12)
??X. don't let opponent block
??X. don't let opponent block
# gf Removed fixed value. (3.5.2)
?O??X. an exception to the preceeding pattern
; does_attack(*,A) && oplay_defend(a,A)
# gf Removed fixed value. (3.5.2)
?O??X. exception, continued
; does_attack(*,A) && oplay_defend(a,A)
..XX? extend along the edge
????..? Two space extension
??Xx? override solid connection
.... extend on third line
XX...x extend on third line
XX...x extend on third line
# gf Removed fixed value and E classification, revised constraint. (3.5.2)
XX...x extend on third line
; !dead(a) && !oplay_disconnect(*,a,*)
############################
# Second line push or extend
############################
.X.O extend to undermine opponent
XX.. move out on second line
# We should climb to third line if safe. Need helper.
..X. Double sente, do it early!
# gf Added n classification. See gifu03:105. (3.5.3)
?..X. Double sente, do it early!
:8,OXn,reverse_followup(2)
# gf Added n classification. See gifu03:105. (3.5.3)
?..X. Double sente, do it early!
:8,OXn,reverse_followup(5)
OX. magari on second line
?XX.?? reverse sente extend
X.?X extend on second line
X.?? extend on second line
X.X extend on second line
?OX.. extend on second line -- reverse sente
??O.X. undermine the opponent and threaten two eyes
.XxoO? make eye and undermine opponent
|.... Double sente, do it early!
# db New pattern (3.1.28)
?Xxx?? simply extend to avoid bad aji
; oplay_attack(a,b,*,c) || x_alive_somewhere(d,e)
# gf Removed fixed value. (3.5.2)
# gf Added constraint. (3.3.12)
# gf Removed fixed value. (3.5.2)
?..X. extend to defend and connect
;!oplay_disconnect(*,*,a)
?.XX.. hane on second line
?XO? hane to claim space on second line
# gf Removed shape bonus. (3.3.18)
?..?? hane to undermine the opponent
# gf Reduced shape value. (3.5.2)
# gf Removed fixed value. (3.5.2)
?..X? after hane opponent must fall back
; !oplay_defend(*,a,b,c,d,e,f,f)
# gf Removed fixed value. (3.5.2)
# gf Removed fixed value. (3.5.2)
# gf Revised pattern. (3.1.3)
# gf Revised constraint. (3.3.13)
# ab Removed followup value (handled by influence code). (3.3.20)
# Followup to previous pattern.
# No need to check for sente. If we found the hane to be worth
# playing, we should continue with the tsugi too. (Unless we can
# follow up with a ko or nakade pattern or something similar, but
# those should have higher values.)
# In practice this pattern doesn't always kick in at a high enough
# value to guarantee that EB1403 will be followed up.
# gf Revised pattern. (3.1.3)
# eb revised constraint (3.3.13)
# ab FIXME: Is this still necessary?
?oX?? Connect after hane.
#cut followup to sente hane
#evand new pattern (3.3.13)
# gf Fixed value removed. (3.5.2)
;!dead(a) && xmoyo(c) && !oplay_defend(*,B) && !oplay_attack_either(*,*,a)
;xmoyo(e) && !oplay_defend_both(*,a,b,?,c,a,D) && !oplay_attack(*,a,b,c,*)
??oo? Hane atop opponent's attachment on third line
...? extend instead of hane
# The attachment is beneficial even if captured except
# in the case where the opponent pushes below leading
# leading to a complicated fight. If this happens
# O3X it is unclear who will come out better. (O can
# 421 retaliate in various ways depending on surroundings
# ... and fighting strength.) Attaching is preferred
# --- to EB313 if it works.
# The final position could be:
# It can backfire if X pushes below. That is not always possible.
????.? attach on second line
????.? attach on second line in sente
;!weak(D) && !oplay_attack(*,a,b,?,c,c)
???.? attach on second line
# gf Reduced shape value. (3.5.2)
# gf Reduced shape value. (3.5.2)
.*X? strengthen stone to prevent undermining hane
# gf New pattern. (3.1.17)
...*.X jump up when kicked
:8,OXa,reverse_followup(8)
O.*X Strengthen stone on second line
??o? Stand to defend connection
??X? Draw back to defend connection
..?? stand after attachment
# If we are strong we prefer to connect solidly
?.O? Defend after hanetsugi
;xcut(a) || xplay_attack(a,b,c)
X*.O? make eye and reach for center
# Sometimes better to hane. But under which constraints?
.....? contact instability
# gf Shape bonus reduced. (3.1.12)
#############################
# Block intrusion from above
#############################
?.X.?? block intrusion into wide extension
?XO don't accept position being split
# evand added shape value -0.5 (3.5.4)
..X.. secure fourth line territory
;safe_xmove(*) && oterri(a)
;!oplay_break_through(*,a,*,b)
.O*. draw back if opponent plays below
;xplay_attack_either(b,a,a,c)
O... draw back if clamp is impossible
# gf Reduced shape value. (3.5.2)
?..... don't jump if the edge is open
# With a sufficiently strong position directly to the right of the
# diagram, this may be a good move to build a moyo.
# gf Reduced shape value. (3.5.2)
?...... don't jump if the edge is open
######################################################################
# Center block/expand patterns
# Moves that expand own position in the center in some way or stops
# opponent from expanding his position. This includes moves like
# block, bend, hane, and various extensions into empty space or
# opponent's area. This category contains very many patterns and may
# need to be split sooner or later.
######################################################################
#################################################
# safe jump out patterns, cannot (usually) be cut
#################################################
# gf Removed d classification (pattern too general). (3.3.13)
???????? jump into empty space
# gf Removed d classification (pattern too general). (3.3.13)
?????? jump into empty space
# gf Removed d classification (pattern too general). (3.3.13)
????? Jump out if starting to get surrounded
# gf Removed d classification (pattern too general). (3.3.13)
# gf Removed d classification (pattern too general). (3.3.13)
.... atari to break X connection
; oplay_attack(*,a,b,c,c)
???? jump out to reduce and possibly expand
; oplay_attack(*,a,b,c,a) || oplay_attack(*,a,d,b,a)
; x_alive_somewhere(a,b,c)
######################################
# unsafe jump out patterns, can be cut
######################################
:8,OE,shape(-1),jump_out_far_helper
:8,OE,shape(-3),jump_out_far_helper
:|,OE,shape(-3),jump_out_far_helper
:8,OE,jump_out_far_helper
# gf New pattern, see 9x9:540. (3.7.8)
:|,OE,shape(2),jump_out_far_helper
# gf Merge with CB208. (3.1.23)
;(lib(a)>1) && (!attack(b) || defend(b))
.*O connect or threaten to connect
# gf Reduced shape value. (3.1.23)
# ab increased shape value (3.1.29)
# gf Added constraint. (3.3.3)
;!attack(A) || !oplay_defend(*,A)
#ab Revised constraint (3.3.3)
# gf Reduced shape value. (3.5.2)
?.? seal opponent in and connect
; oplay_attack_either(*,a,a,B) && (!attack(B) || does_attack(*,B))
# constraint is complementary to CB213.
;!oplay_attack_either(*,a,a,B)
.X.O.? extra value if X can't cut
;oplay_attack_either(*,a,a,B)
# gf Added missing '-' placeholder for classification. (3.1.18)
XO hane at head of two stones.
XX*. block! this can be life or death
;!xarea(a) && !xarea(b) && lib(c)>2 && lib(D)<3
?...? hane at the head of three stones
?..?? hane at the head of two stones
; && oplay_defend_both(*,A,*,b)
; && (oplay_attack(*,A,e) || !x_alive_somewhere(D,F))
# gf Added a classification. (3.5.3)
;!attack(A) && oplay_attack(*,A)
O.Oo protect by drawing back
?..XO hane, threatening atari
:8,OXe,followup(5),shape(2)
# gf New pattern. (3.1.18)
# gf New pattern. (3.3.4)
;xterri(c) && oplay_attack_either(*,a,a,B)
..... kosumi to claim space
# Move out diagonally instead
????? diagonal move to reduce
..O diagonal extension if nothing better
.... Take opponent's vital point for moving out
;(alive(e) || alive(f)) && oplay_attack(*,a,a) && !oplay_attack(*,?,b,c,d,d)
# Kosumi is better if GNU is going to go back and defend anyway.
..... knight's move to claim space
;!xmoyo(e) && oplay_defend(*,a,b,c,d)
# ab removed shape value (3.1.28)
..... knight's move to claim space
;!xmoyo(e) && oplay_attack(*,a,b,c,c)
..... block solid to claim space --
..... not so good if X (easily) can play double hane.
;!oplay_attack(*,a,b,b) || !oplay_attack(*,a,c,d,*)
;!attack(A) || does_attack(*,A)
????? knight's move to claim space
????? one space jump to reduce
# gf Reduced shape value. (3.5.2)
# gf Sometimes it's better shape to jump. See nngs:1180. (3.3.7 )
:8,OXed,reverse_followup(5)
?.... knight's move with good shape
;omoyo(e) || (oplay_attack(*,a,b,c,a) && oplay_attack_either(*,b,a,d,b,d))
# gf Corrected constraint. (3.3.12)
; !oplay_disconnect(*,*,a)
# gf Revised to avoid bad shape. Constraint revised. (3.5.3)
..x connect to reinforce and attack
; !same_dragon(a,b) && (alive(a) || alive(b))
?..? default if previous pattern is not feasible
# gf New pattern. (3.7.4)
??.O Here X has 3 liberties.
# gf Merged with CB253. (3.1.23)
# gf Revised classification and constraint. (3.1.14)
# db added shape value (3.1.28)
;(alive(a) || alive(b)) && !oplay_attack(*,a) && !oplay_attack(*,b)
# gf Added constraint. (3.3.13)
?????? jump! (But not down to second line)
# gf Removed d classification (pattern too general). (3.3.13)
?O.? knight's move to block center
# gf New pattern. (3.7.4)
..O?? knight's move block
O.??? seal the opponent in
O.... sketch a connection
;!attack(a) && lib(a)>2 && !attack(b) && lib(b)>2
O... attach to make shape
# gf Not on the edge without more support, see 9x9:540. (3.7.8)
; || oplay_attack(*,c,d,e,b,a)
; || oplay_attack(*,c,d,e,a,b)
?...? knight's move expansion
.......? block opponent in center
.O.X.? make shape to enclose
..... vital point for both
..... vital point for both
# gf Shape value removed. (3.1.9)
# db reduced shape value (3.1.8)
# gf Revised constraint. (3.3.12)
;!oplay_disconnect(*,*,a)
?.X? make shape - reverse sente
?.?? Push, threatening atari -- Don't play if block at a
...? doesn't leave a cut at b.
;lib(A)==3 && !xdefend_against(a,b)
# FIXED: See global:8 for unexpected match.
; !oplay_disconnect(*,A,*)
??XO? connect three stones
;!xmoyo(a) && !oplay_attack(b,C)
X.O.? jump to move out and separate
# gf No moyo building on the second line, see 9x9:540. (3.7.8)
??....? block to build moyo
#FIXME: Pattern needs revision see nngs:860
# gf Corrected symmetry. (3.1.23)
;!xterri(*) && weak(A) && o_alive_somewhere(b,c,d,e,f,g)
# gf Reduced shape value. (3.5.2)
;lib(A)<=3 && lib(B)>=3 && oplay_attack(*,a,b,c,d,?,A)
# tm removed 'd' attribute (3.1.20) (see arend:3)
# shape only --- other patterns matched give other attributes
?.? prevent X from pushing out
; !safe_omove(a) && lib(B)>1 && lib(C)>1
# gf New pattern. (3.3.3)
# The diagonal move is potentially very problematic since X often
# can play either b or c threatening to cut off *. If that move
# simultaneously threatens something more, we're in trouble. This
# pattern has a very conservative constraint, where it is required
# that neither b nor c is a threat against the connection.
;(x_alive_somewhere(d,e,f,g,h) || xarea(f))
;&& !oplay_disconnect(*,b,*,a) && !oplay_disconnect(*,c,*,a)
# gf New pattern. (3.3.16)
# Another safe variation of the diagonal move. See comment for CB338.
;(x_somewhere(d,e,f,g,h) || xarea(f))
;&& (same_string(a,b) || oplay_attack(*,c,?,i,i))
X... extend to prevent hane
..X. extend to prevent hane and split
# gf New pattern. (3.5.3)
?.X.? extend to prevent hane and split
# evand New pattern. (3.7.1)
# Is there a better way to do this than r_followup, followup, and terri?
:8,OXe,reverse_followup(2),followup(1),terri(3)
;omoyo(a) && omoyo(b) && omoyo(c) && xmoyo(d) && xmoyo(e)
# evand New pattern. (3.7.1)
# evand New pattern. (3.7.1)
# evand New pattern. (3.7.1)
######################################################################
# Edge defend/attack patterns
# Moves that threaten to capture, cut, or destroy eyes, and moves
# defending against this or preventing such moves. Also moves that
# actually do capture or destroy eyes are included here.
######################################################################
?XX? Avoid opponent's push between two stones on second line
X.?? prevent severe attachment
?X? connect against peep (on edge)
|??O? Make sente throw in to kill eye in corner
XXXOX sente throw in to kill eye on the edge
??X? Prevent capture of 2 stones, or forcing sequence
??O? Capture 2 stones, or force opponent
xxxx???? if attached, cut!
# bad to intercept in this case
# Add followup value if this is sente.
??.? atari improves our group
oOX? Make atari to kill eye
;oplay_attack(*,A) && !oplay_attack(*,b)
?XXXO oki --- sacrifice helper because defend2 doesn't see the tesuji
;!oplay_attack(*,c) && !oplay_defend(*,a,b,a)
# gf Added b classification. (3.1.18)
# gf Split pattern and revised constraint. (3.3.3)
??*X sente endgame (maybe rather middle game) move
;oplay_attack(*,A) && !oplay_attack_either(*,*,b)
# gf Added b classification. (3.1.18)
# gf Split pattern and revised constraint. (3.3.3)
??*. sente endgame (maybe rather middle game) move
;oplay_attack(*,A) && oplay_defend_both(*,c,*,b)
# gf Added b classification. (3.1.18)
??*O sente endgame (maybe rather middle game) move
??*O sente endgame (maybe rather middle game) move
oOOo?? Capture some stones
oOO*. Punish X's weak shape
OXO Sacrifice a second stone tesuji
;lib(A)<=2 && lib(B)>1 && lib(C)>1
;&& !oplay_attack(*,a) && !oplay_attack(*,b)
;&& oplay_attack(*,A) && oplay_attack(*,B) && oplay_attack(*,C)
|.o?? hane is big, often urgent
# this can be aji keshi because 1 point above is also sente
# This should not need be a sacrifice pattern, and the constraint
# on the O stones should be superfluous, if only the tactical reading
# could understand a double snapback.
;lib(A)==2 && lib(B)==2 && lib(c)>1 && lib(d)>1
>test_attack_either_move(A,B);
XXOXX swallow either side
;oplay_attack(*,b,C) && oplay_attack(a,b,D)
>test_attack_either_move(C,D);
# This is almost always a good idea.
?XXO decrease eye space in sente (unless it kills)
# helper sets followup value
:8,sXa,throw_in_atari_helper
;lib(A)==2 && lib(a)>1 && !alive(b) && proper_eye(c)
OXO decrease eye space in sente (unless it kills)
# helper sets followup value
:8,sXa,throw_in_atari_helper
;lib(A)==2 && lib(a)>1 && lib(b)>1
|XXO decrease eye space in sente (unless it kills)
# helper sets followup value
:8,sXa,throw_in_atari_helper
; lib(H)>4 || !oplay_defend(*,A,b,C,d,E,f,E)
# gf Reduced shape value. (3.5.2)
?OO..o push through and cut!
; oplay_attack(*,c,d,f,B) && oplay_attack(*,c,d,e,f,g,A)
# gf Reduced shape value. (3.5.2)
# gf Fixed value removed. (3.5.2)
; xplay_defend(a,b,c,d,c)
# gf Removed fixed value. (3.5.2)
?X... jump to take territory on 4-th line
# gf Reduced shape value. (3.5.2)
# gf Reduced shape value. (3.5.2)
?... break ponnuki, threaten to cut
# gf Reduced shape value. (3.5.2)
??..? push to stabilize O
oo....? push to stabilize O and (probably) make territory
;weak(a) && o_alive_somewhere(b,c,d,e)
# gf Removed fixed value. (3.5.2)
..... don't get sealed in!
# gf Reduced shape value. (3.5.2)
......... block to build influence
# gf Removed fixed value. (3.5.2)
# gf Removed fixed value, added B classification. (3.5.2)
?OO... push through and cut
; oplay_attack(*,a,b,c,E) && oplay_attack(*,a,c,D)
# gf Removed fixed value. (3.5.2)
; oplay_attack(*,d,A) && oplay_attack(d,B)
# gf Removed fixed value. (3.5.2)
# tm modified (3.1.20) (nngs:1170)
...X.? extend to defend if attached
# gf Reduced shape value. (3.5.2)
# gf Removed fixed value and revised constraint. (3.5.2)
??X?? connect to defend everything
; alive(G) && !oplay_defend(*,A) && xplay_attack(*,b,c)
??X?? capture to defend everything
; (lib(A)>1) && !oplay_defend(*,a,b,a) && oplay_attack(a,A)
# gf Reduced shape value. (3.5.2)
....? if double hane is not reasonable, extend
; !oplay_attack(a,*,b,c,d,e,F)
oOXx capture one stone---don't descend!
# gf Removed fixed value. (3.5.2)
?o..? pull back to stabilize
# tm Modified (3.1.20) (see nngs:1130)
; !attack(A) && !oplay_defend(*,b,c,b)
# Threaten to capture some stones.
;xterri(a) && !attack(B) && !attack(C) && !oplay_attack(*,?,a,a)
;&& !oplay_defend_both(*,?,a,B,C)
O*. connect solid if descent is impossible
; !attack(A) && !oplay_attack(a,*,*)
O.. don't descend if X can cut
# gf The negative shape value is a temporary measure to avoid
# overvaluation. (3.1.17)
# tm Added right hand side check (3.1.20) (see strategy4:195)
# db removed 'a' classification and reduced negative shape.
oOo??? stop expansion and undermine
;oplay_attack_either(*,a,b,c,a,c)
;&& !oarea(f) && !oarea(g)
# gf Reduced shape value. (3.5.2)
;xplay_attack_either(*,a,b,c,a,c)
# gf Reduced shape value. (3.5.2)
?OO? push through and cut
;oplay_attack_either(*,a,b,c,a,c)
# avoid does_defend since some levels GNU may not see attack on B
?OXX avoid a stupid defense
; does_attack(a,B) && !xplay_attack(a,B)
# descending at 'a' is almost always bad
; oplay_defend(a,*,b,c,d,c)
# gf Reduced shape value. (3.5.2)
|..... atari is usually a better way to use the dead stone
# gf Changed antisuji action to replace action. (3.1.14)
|xXXx fall back to defend territory
# gf New pattern. (3.1.14)
|...... attach at 3-3 to defend
# gf New pattern. (3.1.14)
# This is not redundant in the presence of ED85, since it also infers
# a strategical defense of the stone on the fifth line. If the two O
# stones are not amalgamated, this makes a difference.
|...... attach at 3-3 to defend
# db New pattern (3.1.28)
# db New pattern (3.1.28)
# db New pattern (3.1.28)
# gf Corrected the replace action. (3.1.30)
??...X? take territory on the fourth line
# db New pattern (3.1.28)
# It is difficult to give an exact criterion for when it is good to
# fight this ko. But it is bad to lose it, may even threaten the
# life of the O dragon. See nngs1:11
??XxOo? Don't fight an unfavorable ko!
# db New pattern (3.1.28)
# ab d classification added (3.1.29)
???..o? Jump under on the third line
; oplay_attack(*,a,b,c,d,e,e) && !oplay_attack(*,a,b,c,d,f,e,h)
# db New pattern (3.1.28)
# gf Changed to connection pattern. (3.7.2)
??XXoo Extend after the push
;!oplay_disconnect(*,*,a)
# db New pattern (3.1.30)
# See nngs1:18, where * is found as an owl defense
# ab Added e classification (3.3.20)
.....X? don't make the wrong atari
# gf New pattern. (3.3.13)
oo.O? Significant improvement of eyespace.
.*.OX Often sufficient for local life.
;!attack(B) && safe_xmove(a)
# gf New pattern. (3.3.14)
# gf Added constraint. (3.3.17)
.O.Xx fourth line sente kosumi
# ab New pattern (3.3.20)
;!oplay_connect(a,b,c,d,?,g,?,h,e,f)
# gf New pattern. (3.5.3)
;weak(a) && weak(B) && x_somewhere(c,d)
# evand new Pattern (3.5.4)
;x_alive_somewhere(b,c) && weak(A)
|..X.? stabilize the corner in double sente
:8,OXd,reverse_followup(3)
# gf New pattern. (3.7.8)
..... cut through to weaken
# gf New pattern. (3.7.9)
#####################################################################
# Center defend/attack patterns
# Moves that threaten to capture, cut, or destroy eyes, and moves
# defending against this or preventing such moves. Also moves that
# actually do capture or destroy eyes are included here.
######################################################################
?xx? protect by drawing back
??? Usually better to atari on this side.
;weak(A) || weak(B) || !xterri(*)
xXO? urgent to attack and defend
;lib(E)==2 && !oplay_attack(*,c) && !oplay_defend_both(*,a,b,E,D)
>test_attack_either_move(D,E);
# # gf Too general, removed. See gunnar:87. (3.7.10)
# ?o? don't double atari if it backfires
# ;!oplay_defend_both(*,a,b,c,d,e)
;!attack(B) && oplay_attack(*,a,B)
;oplay_attack(*,b,c,d,e,d) && oplay_attack(*,b,c,d,e,h)
;&& oplay_attack(*,c,b,f,g,f) && oplay_attack(*,c,b,f,g,i)
?XXO decrease eye space in sente (unless it kills)
# helper sets followup value
:8,sXa,throw_in_atari_helper
;lib(A)==2 && lib(a)>1 && lib(b)>1 && proper_eye(c)
# Sometimes the cap or another move in the area kills.
# Always advisable to move out.
XOo atari (not aji keshi)
;attack(b) && !defend(b) && !oplay_attack(*,a)
# Estimate a followup value
?oo atari (not aji keshi)
;attack(a) && !defend(a) && !dead(b)
# Estimate a followup value
# even if X can't cut, this prevents getting sealed
# this pattern works on second or third line also
# Hard to value accurately. Wild guess that it may be worth 20 points.
# gf Inappropriate when scoring, disabled in that case. (3.7.2)
?xxxx capture ladder to eliminate aji
;!doing_scoring && (!same_dragon(a,b) || potential_cutstone(C))
?OOX? tesuji to break out
;(lib(A)>1) && oplay_attack(*,a,b,c,d,e,f)
# gf Reduced shape value. (3.5.2)
.XO create cutting points
# The second move by X at a is intentional and has the effect of X passing.
;&& !oplay_attack(*,a,b,a,c,c) && !oplay_attack(*,a,b,a,d,d)
#tm removed shape bonus (3.1.22) (see nngs:700)
X*.. attack 1 stone to defend and probably connect
# gf Reduced shape value. (3.5.2)
;lib(A)>1 || !oplay_defend(*,A)
# gf Reduced shape value. (3.5.2)
OXx extending usually better than capturing, but not at edge
; lib(A)==1 && lib(b)>1 && does_attack(*,A)
# gf Revised constraint. (3.3.18)
# gf Reduced shape value. (3.5.2)
?XO. atari to prevent opponent's expansion
; alive(b) && attack(a) && !defend(a)
# tm Modified (3.1.20) - added constraint
.X. ponnuki is worth thirty points
# db added X class (3.3.5)
.O. ponnuki is worth thirty points
.O. ponnuki, preventing threat to cut
:8,Oead,shape(3),reverse_followup(8)
; !xplay_attack_either(*,?,a,*,a)
# gf Removed fixed value and reduced shape. (3.5.2)
?OX. break through one way or the other
; oplay_break_through(*,b,c,d,D,d,E) && oplay_break_through(*,c,b,e,F,e,E)
# gf Split and revised. (3.3.14)
# gf Reduced shape value. (3.5.2)
; x_alive_somewhere(a,b,c,d)
# gf Split and revised. (3.3.14)
# gf Reduced shape value. (3.5.2)
; x_alive_somewhere(a,b,c,d) && oplay_connect(*,e,*,f)
# One point to the left is sometimes better
.O? hane, threatening capture
# gf Revised constraint. (3.1.14)
# gf Added !doing_scoring since this can generate a losing ko threat.
# We might want to take it out entirely. (3.3.17)
OX if a cutting stone can't be caught,
X* play in opponent's territory
;!doing_scoring && !attack(A) && !attack(B) && xterri(*)
# FIXME: The two following patterns may be superfluous due to the
*X? don't help the opponent cut
; xplay_attack(a,b,c,c) && !oplay_attack(*,a,b,c,c)
# gf Split pattern. We can't have eE classification unless b is alive. (3.1.32)
... atari using dead stone
;lib(b)>1 && alive(b) && attack(A) && !defend(A)
# gf Split pattern. We can't have eE classification unless b is alive. (3.1.32)
... atari using dead stone
;lib(b)>1 && attack(A) && !defend(A)
?.X? eliminate aji and danger of misreading!
; dead(A) && effective_size(A)>8 && lib(b)<=4
# gf Added O classification. (3.1.12)
; !dead(A) && oplay_attack(*,a,b,c,c)
# gf New pattern. (3.3.18)
;lib(a)==1 && (alive(b) || alive(c))
;&& (xplay_attack(*,b) || xplay_attack(*,c))
######################################################################
# Standard invasions of wide extensions, sequences following
# attachment under edge stones, and other standard patterns
# often warranting a j or J classification.
######################################################################
?.... hane if attached under fourth line stone
..... create cutting points while strengthening own stones
?...? block on top if 2 space extension is invaded
...*.? continuation -- never play 'a' here
#gf New pattern. (3.1.12)
??X..... extend from tsukenobi
# Invade if we have two ladders on our side.
;oplay_attack(*,B,c,D,e,B) && oplay_attack(*,B,c,D,e,F,g,H,I);
# gf New pattern. (3.3.13)
??....? cap stone on third line
# Override capturing single X stone.
?oXXOOo Connect underneath.
# Override capturing single X stone.
?x.XOOo Connect underneath.
XX.. extend on fourth line if pushed
XXX.. extend on fourth line if pushed
XXXX.. extend on fourth line if pushed
........ wedge in after invasion
??..???? connect out beneath
??..???? connect out beneath, continuation
# gf Sometimes it's better to play one step to the left. See
# gf Revised classification. (3.5.2)
...XX common important follow up
..X... hane after attachment
# sometimes the solid connection would be better
# gf Removed fixed value, added d classification. (3.5.2)
?.XX.O draw back to defend
# This pattern is sometimes too general. But more often than not, this is
XXx?? push to prevent opponent's block
# gf Reduced shape value. (3.5.2)
...... almost an antisuji
?....? hane making shape in the center
; !safe_omove(a) && !oplay_attack(*,B)
# tm modified (3.1.23) (see arend:3)
.X. Defend after the peep
........... invade on the third line
; x_alive_somewhere(a,b,c,d)
# Actually 'a' is often playable
..*.. connect on the outside
# tm Modified (3.1.22) (see nngs:1740)
...... connection is urgent for local shape
..... extend to stabilize shape
.......xxx extend to stabilize group
; x_alive_somewhere(a,b,c)
.......? pull back to stabilize group
; o_alive_somewhere(a,b,c,d)
??.x? stop effective cut and probably connect
....... urgent! attach at the top
# sometimes the double hane is better
# gf Split and revised. (3.5.2)
XX... push to expand threatened dragon
# gf Split and revised. (3.5.2)
XX... push to expand threatened dragon
# gf Split and revised. (3.5.2)
XX.... push again to expand threatened dragon
# gf Split and revised. (3.5.2)
XX.... push again to expand threatened dragon
XX.... atari after double hane
?X........ extend from ponnuki to make a base
?X......x extend from ponnuki to make a base
........ standard move to break connection and move out
........ standard move to break connection and move out
........ standard move to break connection and move out
........ standard move to break connection and move out
# If the right edge is the fourth line this is
# not too good because it provokes X to make territory
# but there is no really good move in this case.
x.......... invade open space
#tm modified (3.1.22) (see trevorc:420)
#FIXME: Pattern still seems a bit too general
# consider adding appropriate constraint.
??oo... connection is urgent
; o_alive_somewhere(a,b) && x_alive_somewhere(c,d,e)
; x_alive_somewhere(a,b) && x_alive_somewhere(c,d)
# db generalized (3.1.25)
|...O.x even a computer connects after nozoki
;x_visible_along_edge(A,b)
# gf New pattern. (3.3.14)
?....X.... seal the side to attack
;o_somewhere(a,b,c,d,e,f)
# gf New pattern. (3.3.14)
# FIXME: May wish to prefer other pincers in some situations.
;o_visible_along_edge(A,b)
# gf Made pattern more powerful. (3.1.9)
# gf Added one more replacement point. (3.1.10)
...... Atari before connecting
:8,J,reverse_followup(10)
??O.X? Important sente block
?..... extend automatically
; o_alive_somewhere(a,b,c,d)
??.... extend after the top attachment
# gf New pattern. (3.1.17)
...... connect after invasion
# gf New pattern. (3.1.17)
...... connect after invasion
# db New pattern (3.1.26)
?XX.... extend on the fourth line
# db New pattern (3.1.26)
# gf Demoted from J to j. See e.g. trevorc:1180 and nngs4:485. (3.7.1)
?..... large block affecting stability of both
# db new pattern (3.1.28)
oo......... extend to build moyo
; o_alive_somewhere(a,b,c,d,e,f,g)
# db new pattern (3.1.32)
|..xx....... stand to defend
..XXOO Don't allow the cut with sente!
...... seal the opponent, connecting loosely
; o_alive_somewhere(a,b,c,d,e)
# see nngs3:330 where GNU thinks e is an owl attack
........ seal the opponent
|...O... seal the opponent
# gf New pattern. (3.5.3)
######################################################################
# Patterns to reduce territory into sekis.
# seki_helper(a) verifies that no string surrounding a can be
######################################################################
# With no supporting stones, a 5 points gote seki.
# If X does not reply, the corner point makes ko.
# but this is not a good ko because it takes 4 moves
# to remove the X stones, while O loses the seki
# if it loses the ko. Moreover if X immediately plays
# atari at one 1-2 point we have to answer at the second
# 1-2 point, after which X can leave it without aji. So
# this move is gote and no folloup value is assigned.
;lib(A)==3 && seki_helper(A)
# With no enemy stones, 5 points gote to defend territory.
;lib(a)<=3 && seki_helper(a)
# 7 points sente seki. If X does not answer, we can kill,
# which at the very least is worth another 20 points.
:8,sXe,terri(7),followup(20)
;lib(A)==5 && seki_helper(A)
# 7 points reverse sente to defend territory.
:8,Oe,terri(7),reverse_followup(20)
;lib(a)==5 && seki_helper(a)
# Explicit followup to S4.
;lib(a)==5 && seki_helper(a)
# 6 points seki. Whether this is gote or sente depends on
# the ko threat situation.
:8,sXe,terri(6),followup(14)
;lib(A)==4 && seki_helper(A)
# 6 points seki. Explicit followup to S6.
:8,sXe,terri(6),followup(14)
;lib(A)==3 && seki_helper(A)
# Eliminate a potential 1000-year ko for the life of the entire
# corner. This moves secures a seki.
;lib(a)==3 && seki_helper(a)
:8,Oe,terri(6),reverse_followup(14)
;lib(a)==4 && seki_helper(a)
# gf New pattern. (3.5.3)
# 7 points gote seki. See seki:301.
;lib(A)==4 && seki_helper(A)
# gf New pattern. (3.5.3)
# 7 points seki. Compare S8. See seki:302
;lib(a)==4 && seki_helper(a)
# gf New pattern. (3.5.3)
# 8 points (mostly) sente seki. See seki:801.
:8,sXe,terri(8),followup(16)
;lib(A)==4 && seki_helper(A)
# gf New pattern. (3.5.3)
# Best way to secure seki. See seki:803.
:8,sXe,terri(8),reverse_followup(16)
;lib(a)==4 && seki_helper(a)
# gf New pattern. (3.5.3)
# Make seki in sente, not gote. See seki:808.
:8,sXe,terri(8),followup(16)
;lib(A)==4 && seki_helper(A)
# gf New pattern. (3.5.3)
# Make seki in sente, not gote. See seki:810.
# Only replace pattern here. The seki_helper doesn't apply and the
# semeai code should find either a or * if there's a chance to make seki.
# gf New pattern. (3.5.3)
# 8 points (mostly) reverse sente seki. Compare S10. See seki:802.
:8,sXe,terri(8),reverse_followup(16)
;lib(a)==4 && seki_helper(a)
# gf New pattern. (3.5.3)
# 9 points gote seki. See seki:901.
;lib(A)==5 && seki_helper(A)
# gf New pattern. (3.5.3)
# 9 points seki. Compare S12. See seki:902.
;lib(a)==5 && seki_helper(a)
# gf New pattern. (3.5.3)
# Make sente seki. See seki:905.
# gf New pattern. (3.7.12)
# 9 points gote seki. See seki:1201.
;lib(A)==4 && seki_helper(A)
# gf New pattern. (3.7.12)
# 9 points gote seki. Compare S15. See seki:1202.
;lib(a)==4 && seki_helper(a)
######################################################################
# High handicap patterns.
# Patterns to place additional handicap stones when white starts by
# passing. After white's first move these patterns are not considered
# any more, due to the high_handicap_helper.
######################################################################
....... Add stone where the distance is large.
:+,-,value(40),high_handicap_helper
# gf Corrected symmetry. (3.1.23)
....... Add stone where the distance is large.
:|,-,value(40),high_handicap_helper
?..o..? Make iron pillar.
:|,-,value(30),high_handicap_helper
:|,-,value(30),high_handicap_helper
..... Jump towards center.
:|,-,value(30),high_handicap_helper
|...... Corner enclosure from 3-3.
:8,-,value(30),high_handicap_helper
:8,-,value(20),high_handicap_helper
..... Yet another third line stone.
:8,-,value(10),high_handicap_helper
..... Yet another fourth line stone.
:8,-,value(10),high_handicap_helper
:-,-,value(5),high_handicap_helper
:8,-,value(5),high_handicap_helper
:-,-,value(2),high_handicap_helper
:8,-,value(3),high_handicap_helper
|..O... Solidify corner still more.
:8,-,value(1),high_handicap_helper
|....oo Solidify corner still more.
:8,-,value(1),high_handicap_helper
|..ooo Solidify corner still more.
:8,-,value(1),high_handicap_helper
|..... Solidify corner still more.
:8,-,value(1),high_handicap_helper
######################################################################
# Reinforcement patterns.
######################################################################
# Early in high handicap games, especially on small boards, it may
# happen that the lonely white stones are all thought to be dead.
# These patterns are used in such positions to reinforce possible
# weaknesses that the owl code has failed to take into account.
# All these patterns have s classification. For performance reasons,
# the move safety is tested in the helper instead.
######################################################################
:|,s,value(5),reinforce_helper
:|,s,value(3),reinforce_helper
:-,s,value(2),reinforce_helper
:8,s,value(1),reinforce_helper
:8,s,value(1),reinforce_helper
######################################################################
# Reinforcement patterns for the middle game
######################################################################
# FIXME: This pattern should be contingent on being clearly ahead.
# gf In any case, don't play it while scoring. (3.7.2)
O..O..O Eliminate invasion point
######################################################################
# Endgame patterns of value < 6 are in endgame.db
# "A point with sente is worth 2 with gote."
######################################################################
O.Xx fourth line sente kosumi
# gf Added e classification. (3.5.2)
????? third line sente kosumi
# gf Added e classification. (3.5.2)
# gf Added e classification and constraint. (3.5.2)
;!oplay_disconnect(*,a,b,*,c)
# At move 96 of ego.tst, this is matched at J8.
# tm - revised (3.1.15) (see trevora:330)
# see also trevora:280, arend:23
; omoyo(a) && !(o_alive_somewhere(b) && o_alive_somewhere(c,d))
# gf Changed fixed value to e classification, removed constraint. (3.5.2)
# gf Added e classification. (3.5.2)
# gf Revised constraint. (3.1.14)
OX cut with sente and try to live inside opponent's territory
;xmoyo(*) && !attack(A) && !attack(B)
;&& safe_omove(*) && oplay_attack_either(*,A,B)
# gf Changed fixed value to e classification, removed constraint. (3.5.2)
# gf Changed fixed value to e classification, added reverse followup. (3.5.2)
:8,OXe,reverse_followup(5)
# tm decreased value (3.1.20) (see nngs:1150 move G4)
# gf Don't bother with this inside own territory. (3.1.29)
+---- it's better to bend around
:8,OX,terri(3),followup(2)
######################################################################
# Patterns using the "replace" autohelper macro for when
# "this move is better than that move"
######################################################################
XOO? better to make an eye
# gf New pattern. (3.1.12)
# See test case niki:1 for an example.
# gf New pattern. (3.1.12)
# Common invasion in handicap games. Attaching on top better than
# # tm New Pattern (3.1.17)
# # gf This is too general as gunnar:95 shows. Removed. (3.7.10)
# ?O.| push before blocking
# # tm New pattern (3.1.18) (see trevorb:440)
# # gf This pattern can cause a crash, see ticket #203. Removed. (3.7.12)
# tm New Pattern (3.1.18) (see trevorb:400)
.*... take it off, don't leave atari followup
?..O?? first line block just helps the opponent
?o.X?? to slide is better than kosumi
# See ninestones:20, where hane is a bogus owl defense.
; lib(a)==2 && lib(B)>=2 && !oplay_attack(*,a)
# gf New pattern. (3.3.17)
?XXO backfill before playing into bamboo joint in gote (dame filling)
;oplay_attack(*,b,*) && oplay_defend(*,b,*)
# gf New pattern. (3.3.22)
|..? fix up corner eye shape to avoid seki or worse
;olib(a)==2 && !oplay_attack(a,b,b)
######################################################################
# Patterns to force early moves when playing white against high
# handicaps instead of passing because all stones look dead.
# These patterns are disabled by the thrash_around_helper when white has
# managed to get living stones or when at least 40% of the board is
######################################################################
:|,-,value(5),thrash_around_helper
:|,-,value(5),thrash_around_helper
:8,-,value(3),thrash_around_helper
:|,-,value(3),thrash_around_helper
:8,-,value(1),thrash_around_helper
:8,-,value(1),thrash_around_helper
:8,s,value(4),thrash_around_helper
:8,-,value(5),thrash_around_helper
:8,-,value(3),thrash_around_helper
:8,-,value(3),thrash_around_helper
:8,-,value(2),thrash_around_helper
:|,-,value(3),thrash_around_helper
:8,-,value(3),thrash_around_helper
:8,-,value(2),thrash_around_helper
:8,-,value(2),thrash_around_helper
:8,-,value(3),thrash_around_helper
# FIXME: Give value to all attack threats.
:8,-,value(4),thrash_around_helper
# FIXME: Give value to all attack threats.
:8,s,value(0.5),thrash_around_helper
:8,n,value(1),thrash_around_helper
:8,s,value(0.5),thrash_around_helper
:8,s,value(1),thrash_around_helper
:8,s,value(4),thrash_around_helper
:8,s,value(2),thrash_around_helper
:8,s,value(3),thrash_around_helper
######################################################################
# Mirror breaking patterns.
# Patterns to break mirror go strategies being employed by the opponent.
######################################################################
# gf New pattern. (3.5.11)
;oplay_attack(*,b,c,d,e,f,g,h,i,j,k,l,m,n,p,q,A) && break_mirror_helper(A)
# gf New pattern. (3.5.11)
;oplay_attack(*,d,e,f,g,h,i,j,k,l,m,n,p,q,A) && break_mirror_helper(A)
# gf New pattern. (3.5.11)
;oplay_attack(*,f,g,h,i,j,k,l,m,n,p,q,A) && break_mirror_helper(A)
# gf New pattern. (3.5.11)
;oplay_attack(*,h,i,j,k,l,m,n,p,q,A) && break_mirror_helper(A)
# gf New pattern. (3.5.11)
;oplay_attack(*,j,k,l,m,n,p,q,A) && break_mirror_helper(A)
# gf New pattern. (3.5.11)
;oplay_attack(*,l,m,n,p,q,A) && break_mirror_helper(A)
# gf New pattern. (3.5.11)
;oplay_attack(*,n,p,q,A) && break_mirror_helper(A)
# gf New pattern. (3.5.11)
;oplay_attack(*,q,A) && break_mirror_helper(A)