diff --git a/engine/optics.c b/engine/optics.c
index 195fcf1..bd88db9 100644
|
a
|
b
|
compute_eyes_pessimistic(int pos, struct eyevalue *value, |
| 782 | 782 | int effective_eyesize; |
| 783 | 783 | int bulk_score = 0; |
| 784 | 784 | signed char chainlinks[BOARDMAX]; |
| | 785 | int contains_inset = 0; |
| 785 | 786 | |
| 786 | 787 | /* Stones inside eyespace which do not coincide with a false eye or |
| 787 | 788 | * a halfeye. |
| … |
… |
compute_eyes_pessimistic(int pos, struct eyevalue *value, |
| 815 | 816 | if (!chainlinks[neighbor]) { |
| 816 | 817 | bulk_score += 4; |
| 817 | 818 | mark_string(neighbor, chainlinks, 1); |
| | 819 | /* In a position like this |
| | 820 | * |
| | 821 | * |OOO |
| | 822 | * |X.O |
| | 823 | * |OXO |
| | 824 | * |.OO |
| | 825 | * |.O |
| | 826 | * |OO |
| | 827 | * |
| | 828 | * it would make sense to treat this as a single eyespace |
| | 829 | * but the stone in atari on the edge splits it up in two |
| | 830 | * separate eyespaces which are evaluated as 2222 and 1111 |
| | 831 | * respectively. Since they together in fact are 1122 this |
| | 832 | * is way off. The best solution would be to to merge the |
| | 833 | * eyespaces but since support for evaluating such eyespaces |
| | 834 | * is missing we try to workaround it by setting pessimistic |
| | 835 | * min to zero for both detected eyespaces. |
| | 836 | * |
| | 837 | * The code below does the detection of such stones called |
| | 838 | * inset. Modification of pessimistic min is done later in |
| | 839 | * the function. |
| | 840 | */ |
| | 841 | if (countlib(neighbor) == 1 |
| | 842 | && attack(neighbor, NULL) != 0) { |
| | 843 | int is_inset = 1; |
| | 844 | int splits_eyespace = 0; |
| | 845 | int m; |
| | 846 | |
| | 847 | for (m = 0; m < 4; m++) { |
| | 848 | if (ON_BOARD(neighbor + delta[m])) { |
| | 849 | if (eye[neighbor + delta[m]].color == eye[pos].color) { |
| | 850 | if (eye[neighbor + delta[m]].origin != pos) |
| | 851 | splits_eyespace = 1; |
| | 852 | } |
| | 853 | else |
| | 854 | is_inset = 0; |
| | 855 | } |
| | 856 | } |
| | 857 | contains_inset |= (is_inset & splits_eyespace); |
| | 858 | } |
| 818 | 859 | } |
| 819 | 860 | } |
| 820 | 861 | else if (!ON_BOARD(neighbor)) |
| … |
… |
compute_eyes_pessimistic(int pos, struct eyevalue *value, |
| 878 | 919 | DEBUG(DEBUG_EYES, " pessimistic min revised to 1 (interior stones)\n"); |
| 879 | 920 | } |
| 880 | 921 | |
| | 922 | if (contains_inset) { |
| | 923 | *pessimistic_min = 0; |
| | 924 | DEBUG(DEBUG_EYES, " pessimistic min revised to 0 (contains inset)\n"); |
| | 925 | } |
| | 926 | |
| 881 | 927 | if (attack_point |
| 882 | 928 | && *attack_point == NO_MOVE |
| 883 | 929 | && max_eyes(value) != *pessimistic_min) { |