RCS file: /cvsroot/gnugo/gnugo/engine/owl.c,v
retrieving revision 1.237
diff -u -r1.237 owl.c
|
|
|
|
| 231 | 231 | struct local_owl_data *owl); |
| 232 | 232 | static void eat_lunch_escape_bonus(int lunch, int *min, int *probable, |
| 233 | 233 | int *max, struct local_owl_data *owl); |
| | 234 | static int select_new_goal_origin(int origin, struct local_owl_data *owl); |
| 234 | 235 | static void compute_owl_escape_values(struct local_owl_data *owl); |
| 235 | 236 | static int owl_escape_route(struct local_owl_data *owl); |
| 236 | 237 | static void do_owl_analyze_semeai(int apos, int bpos, |
| … |
… |
|
| 2085 | 2086 | */ |
| 2086 | 2087 | if (IS_STONE(board[str])) |
| 2087 | 2088 | origin = str; |
| 2088 | | else { |
| 2089 | | int pos; |
| 2090 | | origin = NO_MOVE; |
| 2091 | | for (pos = BOARDMIN; pos < BOARDMAX; pos++) { |
| 2092 | | if (board[pos] == color && owl->goal[pos] == 1) { |
| 2093 | | origin = find_origin(pos); |
| 2094 | | break; |
| 2095 | | } |
| 2096 | | } |
| 2097 | | } |
| | 2089 | else |
| | 2090 | origin = select_new_goal_origin(NO_MOVE, owl); |
| 2098 | 2091 | |
| 2099 | 2092 | /* Test whether the move cut the goal dragon apart. */ |
| 2100 | | if (moves[k].cuts[0] != NO_MOVE) |
| | 2093 | if (moves[k].cuts[0] != NO_MOVE) { |
| 2101 | 2094 | owl_test_cuts(owl->goal, owl->color, moves[k].cuts); |
| | 2095 | if (!owl->goal[origin]) |
| | 2096 | origin = select_new_goal_origin(origin, owl); |
| | 2097 | } |
| 2102 | 2098 | mark_goal_in_sgf(owl->goal); |
| 2103 | 2099 | |
| 2104 | 2100 | if (origin == NO_MOVE) |
| … |
… |
|
| 6228 | 6224 | } |
| 6229 | 6225 | |
| 6230 | 6226 | |
| | 6227 | /* Find a new origin when it has been captured or cut out of the |
| | 6228 | * goal. Used in do_owl_attack() |
| | 6229 | */ |
| | 6230 | static int |
| | 6231 | select_new_goal_origin(int origin, struct local_owl_data *owl) |
| | 6232 | { |
| | 6233 | int pos; |
| | 6234 | for (pos = BOARDMIN; pos < BOARDMAX; pos++) |
| | 6235 | if (board[pos] == owl->color && owl->goal[pos] == 1) |
| | 6236 | return find_origin(pos); |
| | 6237 | |
| | 6238 | return origin; |
| | 6239 | } |
| | 6240 | |
| | 6241 | |
| 6231 | 6242 | /* Retrieve topological eye values stored in the half_eye[] array of |
| 6232 | 6243 | * the current owl data. |
| 6233 | 6244 | * |