GNU Go Documentation
11.10 Functions in `optics.c'
Here are the public functions in `optics.c', except some simple
access functions used by autohelpers. The statically declared functions
are documented in the source code.
void make_domains(struct eye_data b_eye[BOARDMAX], struct eye_data w_eye[BOARDMAX], int owl_call)
This function is called from make_dragons() and from
owl_determine_life(). It marks the black and white domains
(eyeshape regions) and collects some statistics about each one.
void compute_eyes(int pos, int *max, int *min, int *attack_point, int *defense_point, struct eye_data eye[BOARDMAX], struct half_eye_data heye[BOARDMAX], int add_moves, int color)
Given an eyespace with origin pos, this function computes the
minimum and maximum numbers of eyes the space can yield. If max and
min are different, then vital points of attack and defense are also
generated.
void compute_eyes_pessimistic(int pos, int *max, int *min, int *pessimistic_min, int *attack_point, int *defense_point, struct eye_data eye[BOARDMAX], struct half_eye_data heye[BOARDMAX])
This function works like compute_eyes(), except that it also gives
a pessimistic view of the chances to make eyes.
void propagate_eye(int origin, struct eye_data eye[BOARDMAX])
Copies the data at origin to the rest of the eye (invariant
fields only).
static int recognize_eye(int pos, int *attack_point, int *defense_point, int *max, int *min, struct eye_data eye[BOARDMAX], struct half_eye_data heye[BOARDMAX], int add_moves, int color)
Declared static but documented here because of its importance. The life
code supplies an alternative version of this function called
recognize_eye2(). Here pos is the origin of an
eyespace. Returns 1 if there is a pattern in `eyes.db' matching the
eyespace, or 0 if no match is found. If there is a key point for attack,
*attack_point is set to its location, or NO_MOVE if there is
none. Similarly *defense_point is the location of a vital defense
point. *min and *max are the minimum and maximum number of eyes
that can be made in this eyespace respectively. Vital attack/defense points
exist if and only if *min != *max. If add_moves==1, this
function may add a move_reason for color at a vital point which
is found by the function. If add_moves==0, set color==EMPTY.
void add_false_eye(int pos, struct eye_data eye[BOARDMAX], struct half_eye_data heye[BOARDMAX])
This function turns a proper eyespace into a margin.
float topological_eye(int pos, int color, struct eye_data b_eye[BOARDMAX], struct eye_data w_eye[BOARDMAX], struct half_eye_data heye[BOARDMAX])
See See section 11.7 Topology of Half Eyes and False Eyes. Evaluate the eye space at pos
topologically (see section 11.7 Topology of Half Eyes and False Eyes). Returns 2 or less if pos
is a proper eye for color; between 2 and 3 if the eye can be made
false only by ko; 3 if pos is a half eye; between 3 and 4 if the
eye can be made real only by ko; 4 if pos is a false eye. Attack
and defense points for control of the diagonals are stored in the
heye[] array.