Next: Half Eyes, Previous: Amalgamation, Up: Worms and Dragons
The fields black_eye.cut
and white_eye.cut
are set where the
opponent can cut, and this is done by the B (break) class patterns in
conn.db. There are two important uses for this field, which can be
accessed by the autohelper functions xcut()
and ocut()
. The
first use is to stop amalgamation in positions like
..X.. OO*OO X.O.X ..O..
where X can play at * to cut off either branch. What happens
here is that first connection pattern CB1 finds the double cut
and marks * as a cutting point. Later the C (connection) class
patterns in conn.db are searched to find secure connections
over which to amalgamate dragons. Normally a diagonal
connection would be deemed secure and amalgamated by connection
pattern CC101, but there is a constraint requiring that neither of
the empty intersections is a cutting point.
A weakness with this scheme is that X can only cut one connection, not
both, so we should be allowed to amalgamate over one of the connections.
This is performed by connection pattern CC401, which with the help of
amalgamate_most_valuable_helper()
decides which connection to
prefer.
The other use is to simplify making alternative connection patterns to
the solid connection. Positions where the diag_miai helper thinks a
connection is necessary are marked as cutting points by connection
pattern 12. Thus we can write a connection pattern like CC6
:
?xxx? straight extension to connect XOO*? O...? :8,C,NULL ?xxx? XOOb? Oa..? ;xcut(a) && odefend_against(b,a)
where we verify that a move at *
would stop the enemy from safely
playing at the cutting point, thus defending against the cut.