RCS file: /cvsroot/gnugo/gnugo/engine/liberty.h,v
retrieving revision 1.258
diff -u -r1.258 liberty.h
|
|
|
|
| 408 | 408 | void register_good_attack_threat(int move, int target); |
| 409 | 409 | int is_known_good_attack_threat(int move, int target); |
| 410 | 410 | |
| | 411 | void register_known_safe_move(int move); |
| | 412 | int is_known_safe_move(int move); |
| | 413 | |
| 411 | 414 | int get_attack_threats(int pos, int max_strings, int strings[]); |
| 412 | 415 | int get_defense_threats(int pos, int max_strings, int strings[]); |
| 413 | 416 | void get_saved_worms(int pos, signed char saved[BOARDMAX]); |
RCS file: /cvsroot/gnugo/gnugo/engine/move_reasons.c,v
retrieving revision 1.135
diff -u -r1.135 move_reasons.c
|
|
|
|
| 74 | 74 | /* Attack threats that are known to be sente locally. */ |
| 75 | 75 | static int known_good_attack_threats[BOARDMAX][MAX_ATTACK_THREATS]; |
| 76 | 76 | |
| | 77 | /* Moves that are known to be safe (in the sense that played stones can |
| | 78 | * be captured, but opponent loses much more when attempting to do so) |
| | 79 | */ |
| | 80 | static int known_safe_moves[BOARDMAX]; |
| 77 | 81 | |
| 78 | 82 | /* Helper functions to check conditions in discard rules. */ |
| 79 | 83 | typedef int (*discard_condition_fn_ptr)(int pos, int what); |
| … |
… |
|
| 138 | 142 | } |
| 139 | 143 | |
| 140 | 144 | for (pos = BOARDMIN; pos < BOARDMAX; pos++) { |
| | 145 | known_safe_moves[pos] = 0; |
| 141 | 146 | for (k = 0; k < MAX_ATTACK_THREATS; k++) |
| 142 | 147 | known_good_attack_threats[pos][k] = NO_MOVE; |
| 143 | 148 | } |
| … |
… |
|
| 2023 | 2028 | return 0; |
| 2024 | 2029 | } |
| 2025 | 2030 | |
| | 2031 | /* Like documented in endgame:980, there are also moves which aren't |
| | 2032 | * safe by themselves, but attempting to capture these stones would |
| | 2033 | * result in a loss for the opponent (typically, by damezumari). |
| | 2034 | * Simple examples include snapbacks, but more complicated ones do |
| | 2035 | * exist. Following functions are helpers for the valuation processing |
| | 2036 | * which deal with such special cases. |
| | 2037 | */ |
| | 2038 | void |
| | 2039 | register_known_safe_move(int move) |
| | 2040 | { |
| | 2041 | ASSERT_ON_BOARD1(move); |
| | 2042 | |
| | 2043 | known_safe_moves[move] = 1; |
| | 2044 | } |
| | 2045 | |
| | 2046 | |
| | 2047 | int |
| | 2048 | is_known_safe_move(int move) |
| | 2049 | { |
| | 2050 | ASSERT_ON_BOARD1(move); |
| | 2051 | |
| | 2052 | return known_safe_moves[move]; |
| | 2053 | } |
| | 2054 | |
| 2026 | 2055 | |
| 2027 | 2056 | /* |
| 2028 | 2057 | * Local Variables: |
RCS file: /cvsroot/gnugo/gnugo/engine/value_moves.c,v
retrieving revision 1.170
diff -u -r1.170 value_moves.c
|
|
|
|
| 1068 | 1068 | int tactical_safety = 0; |
| 1069 | 1069 | if (!ON_BOARD(pos)) |
| 1070 | 1070 | continue; |
| | 1071 | tactical_safety = is_known_safe_move(pos); |
| 1071 | 1072 | |
| 1072 | 1073 | for (k = 0; k < MAX_REASONS; k++) { |
| 1073 | 1074 | int r = move[pos].reason[k]; |
| … |
… |
|
| 2461 | 2462 | |
| 2462 | 2463 | mark_inessential_stones(OTHER_COLOR(color), safe_stones); |
| 2463 | 2464 | |
| 2464 | | if (move[pos].move_safety == 1 && safe_move(pos, color) != 0) { |
| | 2465 | if (move[pos].move_safety == 1 |
| | 2466 | && (is_known_safe_move(pos) || safe_move(pos, color) != 0)) { |
| 2465 | 2467 | safe_stones[pos] = INFLUENCE_SAVED_STONE; |
| 2466 | 2468 | strength[pos] = DEFAULT_STRENGTH; |
| 2467 | 2469 | if (0) |
RCS file: /cvsroot/gnugo/gnugo/patterns/endgame.db,v
retrieving revision 1.69
diff -u -r1.69 endgame.db
|
|
|
|
| 444 | 444 | ;marginal_eye(*) && proper_eye(a) && max_eye_value(a) > 0 |
| 445 | 445 | |
| 446 | 446 | |
| | 447 | Pattern EE201b |
| | 448 | |
| | 449 | ?XX push deeper on first line. |
| | 450 | O.* |
| | 451 | --- |
| | 452 | |
| | 453 | :8,sOXe |
| | 454 | |
| | 455 | ?XX |
| | 456 | Oa* |
| | 457 | --- |
| | 458 | |
| | 459 | ;marginal_eye(a) && proper_eye(*) && max_eye_value(*) > 0 |
| | 460 | ;&& (safe_omove(*) || oplay_attack(*,a,a)) |
| | 461 | |
| | 462 | >if (!safe_omove(*)) known_safe_move(*) |
| | 463 | |
| | 464 | |
| 447 | 465 | Pattern EE202 |
| 448 | 466 | |
| 449 | 467 | OXX. endgame move |
| … |
… |
|
| 1582 | 1600 | X*X Wedge |
| 1583 | 1601 | O.X |
| 1584 | 1602 | |
| 1585 | | :8,OXe |
| | 1603 | :8,sOXe |
| 1586 | 1604 | |
| 1587 | 1605 | B*X |
| 1588 | 1606 | OaX |
| 1589 | 1607 | |
| 1590 | 1608 | ;oplay_attack_either(*,a,a,B) |
| 1591 | 1609 | |
| | 1610 | >if (!safe_omove(*)) known_safe_move(*) |
| | 1611 | |
| 1592 | 1612 | |
| 1593 | 1613 | Pattern CE31 |
| 1594 | 1614 | # gf New pattern. (3.3.6) |
RCS file: /cvsroot/gnugo/gnugo/patterns/mkpat.c,v
retrieving revision 1.156
diff -u -r1.156 mkpat.c
|
|
|
|
| 436 | 436 | {"adjacent_to_defendable_stone_in_atari", 1, 0, 1.0, |
| 437 | 437 | "adjacent_to_defendable_stone_in_atari(%s)"}, |
| 438 | 438 | {"good_attack_threat", 2, 0, 0.01, "register_good_attack_threat(%s, %s)"}, |
| | 439 | {"known_safe_move", 1, 0, 0.01, "register_known_safe_move(%s)"}, |
| 439 | 440 | {"break_mirror_helper", 1, 0, 0.01, "break_mirror_helper(%s, color)"} |
| 440 | 441 | }; |
| 441 | 442 | |