diff --git a/engine/owl.c b/engine/owl.c
index 9b87cc0..9dc7574 100644
|
a
|
b
|
static int semeai_trymove_and_recurse(int apos, int bpos, |
| 267 | 267 | int move_value, const char *move_name, |
| 268 | 268 | enum same_dragon_value same_dragon, |
| 269 | 269 | struct matched_pattern_data *pattern_data, |
| 270 | | int lunch, int *semeai_move, |
| | 270 | int lunch, int pass, int *semeai_move, |
| 271 | 271 | int *this_resulta, int *this_resultb); |
| 272 | 272 | static void semeai_add_sgf_comment(int value, int owl_phase); |
| 273 | 273 | static int semeai_trust_tactical_attack(int str); |
| … |
… |
owl_analyze_semeai_after_move(int move, int color, int apos, int bpos, |
| 579 | 579 | else { |
| 580 | 580 | semeai_trymove_and_recurse(bpos, apos, owlb, owla, owl, |
| 581 | 581 | move, color, 1, 0, "mandatory move", |
| 582 | | SAME_DRAGON_MAYBE_CONNECTED, NULL, NO_MOVE, |
| | 582 | SAME_DRAGON_MAYBE_CONNECTED, NULL, NO_MOVE, 0, |
| 583 | 583 | semeai_move, resultb, resulta); |
| 584 | 584 | *resulta = REVERSE_RESULT(*resulta); |
| 585 | 585 | *resultb = REVERSE_RESULT(*resultb); |
| … |
… |
do_owl_analyze_semeai(int apos, int bpos, |
| 1094 | 1094 | owla, owlb, 50, |
| 1095 | 1095 | critical_semeai_worms); |
| 1096 | 1096 | owl_add_move(moves, backfill_outside_liberty.pos, move_value, |
| 1097 | | "backfilling move", SAME_DRAGON_NOT_CONNECTED, NO_MOVE, 0, |
| | 1097 | "backfilling move for outer liberty", SAME_DRAGON_NOT_CONNECTED, NO_MOVE, 0, |
| 1098 | 1098 | NO_MOVE, MAX_SEMEAI_MOVES, NULL); |
| 1099 | 1099 | riskless_move_found = 1; |
| 1100 | 1100 | TRACE("Added %1m %d (6)\n", backfill_outside_liberty.pos, move_value); |
| … |
… |
do_owl_analyze_semeai(int apos, int bpos, |
| 1110 | 1110 | riskless_move_found = 1; |
| 1111 | 1111 | TRACE("Added %1m %d (5)\n", eyefilling_liberty.pos, move_value); |
| 1112 | 1112 | } |
| 1113 | | else if (safe_common_liberty_found |
| | 1113 | else if (!(pass & color) && safe_common_liberty_found |
| 1114 | 1114 | && common_liberty.pos != NO_MOVE) { |
| 1115 | 1115 | move_value = semeai_move_value(common_liberty.pos, |
| 1116 | 1116 | owla, owlb, 10, |
| … |
… |
do_owl_analyze_semeai(int apos, int bpos, |
| 1122 | 1122 | riskless_move_found = 1; |
| 1123 | 1123 | TRACE("Added %1m %d (7)\n", common_liberty.pos, move_value); |
| 1124 | 1124 | } |
| 1125 | | else if (backfill_common_liberty.pos != NO_MOVE) { |
| | 1125 | else if (!(pass & color) && backfill_common_liberty.pos != NO_MOVE) { |
| 1126 | 1126 | move_value = semeai_move_value(backfill_common_liberty.pos, |
| 1127 | 1127 | owla, owlb, 10, |
| 1128 | 1128 | critical_semeai_worms); |
| 1129 | 1129 | owl_add_move(moves, backfill_common_liberty.pos, move_value, |
| 1130 | | "backfilling move", SAME_DRAGON_NOT_CONNECTED, NO_MOVE, 0, |
| | 1130 | "backfilling move for common liberty", SAME_DRAGON_NOT_CONNECTED, NO_MOVE, 0, |
| 1131 | 1131 | NO_MOVE, MAX_SEMEAI_MOVES, NULL); |
| 1132 | 1132 | /* Playing a backfilling move for common liberties inside own |
| 1133 | 1133 | * eyespace is not risk free, regardless of the tactical |
| … |
… |
do_owl_analyze_semeai(int apos, int bpos, |
| 1196 | 1196 | best_resulta == 0 || best_resultb == 0, |
| 1197 | 1197 | moves[k].value, moves[k].name, |
| 1198 | 1198 | moves[k].same_dragon, moves[k].pattern_data, |
| 1199 | | moves[k].lunch, NULL, |
| | 1199 | moves[k].lunch, pass, NULL, |
| 1200 | 1200 | &this_resulta, &this_resultb)) { |
| 1201 | 1201 | tested_moves++; |
| 1202 | 1202 | if (this_resultb == WIN && this_resulta == WIN) { |
| … |
… |
do_owl_analyze_semeai(int apos, int bpos, |
| 1285 | 1285 | */ |
| 1286 | 1286 | if (best_resulta == 0 && best_resultb == 0 |
| 1287 | 1287 | && !riskless_move_found) { |
| 1288 | | if (pass) { |
| | 1288 | if (pass & OTHER_COLOR(color)) { |
| 1289 | 1289 | if (max_eyes(&probable_eyes_a) < min_eyes(&probable_eyes_b)) { |
| 1290 | 1290 | *resulta = 0; |
| 1291 | 1291 | *resultb = 0; |
| … |
… |
do_owl_analyze_semeai(int apos, int bpos, |
| 1317 | 1317 | else { |
| 1318 | 1318 | /* No working move was found, but opponent hasn't passed. Then we pass. */ |
| 1319 | 1319 | do_owl_analyze_semeai(bpos, apos, owlb, owla, |
| 1320 | | resultb, resulta, NULL, 1, owl_phase); |
| | 1320 | resultb, resulta, NULL, pass | color, owl_phase); |
| 1321 | 1321 | *resulta = REVERSE_RESULT(*resulta); |
| 1322 | 1322 | *resultb = REVERSE_RESULT(*resultb); |
| 1323 | 1323 | TRACE("No move found\n"); |
| … |
… |
do_owl_analyze_semeai(int apos, int bpos, |
| 1358 | 1358 | || (best_resulta == KO_B && best_resultb == KO_B |
| 1359 | 1359 | && is_ko(best_move, owla->color, NULL))) { |
| 1360 | 1360 | do_owl_analyze_semeai(bpos, apos, owlb, owla, &this_resultb, |
| 1361 | | &this_resulta, NULL, 1, owl_phase); |
| | 1361 | &this_resulta, NULL, pass | color, owl_phase); |
| 1362 | 1362 | if (REVERSE_RESULT(this_resulta) >= best_resulta |
| 1363 | 1363 | && REVERSE_RESULT(this_resultb) >= best_resultb) { |
| 1364 | 1364 | best_move = PASS_MOVE; |
| … |
… |
semeai_trymove_and_recurse(int apos, int bpos, struct local_owl_data *owla, |
| 1391 | 1391 | int move_value, const char *move_name, |
| 1392 | 1392 | enum same_dragon_value same_dragon, |
| 1393 | 1393 | struct matched_pattern_data *pattern_data, |
| 1394 | | int lunch, int *semeai_move, |
| | 1394 | int lunch, int pass, int *semeai_move, |
| 1395 | 1395 | int *this_resulta, int *this_resultb) |
| 1396 | 1396 | { |
| 1397 | 1397 | int ko_move = 0; |
| … |
… |
semeai_trymove_and_recurse(int apos, int bpos, struct local_owl_data *owla, |
| 1494 | 1494 | else { |
| 1495 | 1495 | do_owl_analyze_semeai(bpos, apos, owlb, owla, |
| 1496 | 1496 | this_resultb, this_resulta, semeai_move, |
| 1497 | | 0, owl_phase); |
| | 1497 | pass, owl_phase); |
| 1498 | 1498 | *this_resulta = REVERSE_RESULT(*this_resulta); |
| 1499 | 1499 | *this_resultb = REVERSE_RESULT(*this_resultb); |
| 1500 | 1500 | } |