RCS file: /home/arend/Go/gnugo-rsync/gnugo/engine/dragon.c,v
retrieving revision 1.158
diff -u -p -r1.158 dragon.c
|
|
|
|
| 70 | 70 | static int compute_crude_status(int pos); |
| 71 | 71 | static int compute_escape(int pos, int dragon_status_known); |
| 72 | 72 | static void compute_surrounding_moyo_sizes(const struct influence_data *q); |
| | 73 | static void clear_cut_list(void); |
| 73 | 74 | |
| 74 | 75 | static int dragon2_initialized; |
| 75 | 76 | static int lively_white_dragons; |
| … |
… |
|
| 663 | 664 | */ |
| 664 | 665 | number_of_dragons = 0; |
| 665 | 666 | |
| | 667 | clear_cut_list(); |
| | 668 | |
| 666 | 669 | memset(black_vital_points, 0, BOARDMAX * sizeof(struct vital_eye_points)); |
| 667 | 670 | memset(white_vital_points, 0, BOARDMAX * sizeof(struct vital_eye_points)); |
| 668 | 671 | } |
| … |
… |
|
| 2370 | 2373 | } |
| 2371 | 2374 | |
| 2372 | 2375 | |
| | 2376 | /************************************************************************ |
| | 2377 | * A list of all cuts found during connection matching * |
| | 2378 | ************************************************************************/ |
| | 2379 | |
| | 2380 | #define MAX_CUTS 3 * MAX_BOARD * MAX_BOARD |
| | 2381 | |
| | 2382 | struct cut_data { |
| | 2383 | int a; |
| | 2384 | int b; |
| | 2385 | int move; |
| | 2386 | }; |
| | 2387 | |
| | 2388 | static int num_cuts = 0; |
| | 2389 | static struct cut_data cut_list[MAX_CUTS]; |
| | 2390 | |
| | 2391 | static void |
| | 2392 | clear_cut_list() |
| | 2393 | { |
| | 2394 | num_cuts = 0; |
| | 2395 | } |
| | 2396 | |
| | 2397 | void |
| | 2398 | add_cut(int apos, int bpos, int move) |
| | 2399 | { |
| | 2400 | gg_assert(board[apos] == board[bpos]); |
| | 2401 | if (num_cuts == MAX_CUTS) |
| | 2402 | return; |
| | 2403 | if (apos > bpos) { |
| | 2404 | int tmp = apos; |
| | 2405 | apos = bpos; |
| | 2406 | bpos = tmp; |
| | 2407 | } |
| | 2408 | if (move == NO_MOVE) |
| | 2409 | return; |
| | 2410 | cut_list[num_cuts].a = apos; |
| | 2411 | cut_list[num_cuts].b = bpos; |
| | 2412 | cut_list[num_cuts].move = move; |
| | 2413 | num_cuts++; |
| | 2414 | if (0) |
| | 2415 | gprintf("Added %d-th cut at %1m between %1m and %1m.\n", num_cuts, |
| | 2416 | move, apos, bpos); |
| | 2417 | } |
| | 2418 | |
| | 2419 | void |
| | 2420 | cut_reasons(int color) |
| | 2421 | { |
| | 2422 | int k; |
| | 2423 | for (k = 0; k < num_cuts; k++) |
| | 2424 | if (board[cut_list[k].a] == OTHER_COLOR(color) |
| | 2425 | && !is_same_dragon(cut_list[k].a, cut_list[k].b) |
| | 2426 | && string_connect(cut_list[k].a, cut_list[k].b, NULL) == WIN) |
| | 2427 | add_cut_move(cut_list[k].move, cut_list[k].a, cut_list[k].b); |
| | 2428 | } |
| | 2429 | |
| 2373 | 2430 | |
| 2374 | 2431 | /* ================================================================ */ |
| 2375 | 2432 | /* Debugger functions */ |
RCS file: /home/arend/Go/gnugo-rsync/gnugo/engine/genmove.c,v
retrieving revision 1.112
diff -u -p -r1.112 genmove.c
|
|
|
|
| 278 | 278 | worm_reasons(color); |
| 279 | 279 | semeai_move_reasons(color); |
| 280 | 280 | owl_reasons(color); |
| | 281 | cut_reasons(color); |
| 281 | 282 | break_in_move_reasons(color); |
| 282 | 283 | } |
| 283 | 284 | |
RCS file: /home/arend/Go/gnugo-rsync/gnugo/engine/liberty.h,v
retrieving revision 1.252
diff -u -p -r1.252 liberty.h
|
|
|
|
| 323 | 323 | float strength[BOARDMAX]); |
| 324 | 324 | void mark_inessential_stones(int color, signed char safe_stones[BOARDMAX]); |
| 325 | 325 | |
| | 326 | void add_cut(int apos, int bpos, int move); |
| | 327 | void cut_reasons(int color); |
| | 328 | |
| 326 | 329 | void get_lively_stones(int color, signed char safe_stones[BOARDMAX]); |
| 327 | 330 | int is_same_worm(int w1, int w2); |
| 328 | 331 | int is_worm_origin(int w, int pos); |
RCS file: /home/arend/Go/gnugo-rsync/gnugo/patterns/conn.db,v
retrieving revision 1.43
diff -u -p -r1.43 conn.db
|
|
|
|
| 585 | 585 | a |
| 586 | 586 | b |
| 587 | 587 | |
| 588 | | ;!xcut(a) && !oplay_disconnect(b,c) |
| | 588 | ;!xcut(a) && !disconnect_helper(b,c) |
| 589 | 589 | |
| 590 | 590 | |
| 591 | 591 | Pattern CC504 |
| … |
… |
|
| 598 | 598 | Xb |
| 599 | 599 | ca |
| 600 | 600 | |
| 601 | | ;!xcut(a) && !oplay_disconnect(b,c) |
| | 601 | ;!xcut(a) && !disconnect_helper(b,c) |
| 602 | 602 | |
| 603 | 603 | |
| 604 | 604 | Pattern CC505 |
| … |
… |
|
| 611 | 611 | Bc |
| 612 | 612 | dA |
| 613 | 613 | |
| 614 | | ;(attack(A) || attack(B)) && !oplay_disconnect(c,d) |
| | 614 | ;(attack(A) || attack(B)) && !disconnect_helper(c,d) |
| 615 | 615 | |
| 616 | 616 | |
| 617 | 617 | Pattern CC506 |
| … |
… |
|
| 628 | 628 | b |
| 629 | 629 | d |
| 630 | 630 | |
| 631 | | ;!xcut(a) && !xcut(b) && !oplay_disconnect(c,d) |
| | 631 | ;!xcut(a) && !xcut(b) && !disconnect_helper(c,d) |
| 632 | 632 | |
| 633 | 633 | |
| 634 | 634 | Pattern CC506b |
| … |
… |
|
| 645 | 645 | ab |
| 646 | 646 | d. |
| 647 | 647 | |
| 648 | | ;!xcut(a) && !xcut(b) && lib(E)<=2 && !oplay_disconnect(c,d) |
| | 648 | ;!xcut(a) && !xcut(b) && lib(E)<=2 && !disconnect_helper(c,d) |
| 649 | 649 | |
| 650 | 650 | |
| 651 | 651 | Pattern CC507 |
| … |
… |
|
| 660 | 660 | ab |
| 661 | 661 | xd |
| 662 | 662 | |
| 663 | | ;!xcut(a) && !xcut(b) && !oplay_disconnect(c,d) |
| | 663 | ;!xcut(a) && !xcut(b) && !disconnect_helper(c,d) |
| 664 | 664 | |
| 665 | 665 | |
| 666 | 666 | Pattern CC508 |
| … |
… |
|
| 675 | 675 | aX |
| 676 | 676 | xc |
| 677 | 677 | |
| 678 | | ;!xcut(a) && !oplay_disconnect(b,c) |
| | 678 | ;!xcut(a) && !disconnect_helper(b,c) |
| 679 | 679 | |
| 680 | 680 | |
| 681 | 681 | Pattern CC509 |
| … |
… |
|
| 692 | 692 | cd |
| 693 | 693 | xf |
| 694 | 694 | |
| 695 | | ;!xcut(a) && !xcut(b) && !xcut(c) && !xcut(d) && !oplay_disconnect(e,f) |
| | 695 | ;!xcut(a) && !xcut(b) && !xcut(c) && !xcut(d) && !disconnect_helper(e,f) |
| 696 | 696 | |
| 697 | 697 | |
| 698 | 698 | Pattern CC511 |
RCS file: /home/arend/Go/gnugo-rsync/gnugo/patterns/connections.c,v
retrieving revision 1.44
diff -u -p -r1.44 connections.c
|
|
|
|
| 25 | 25 | #include "patterns.h" |
| 26 | 26 | |
| 27 | 27 | |
| | 28 | /* Test whether apos and bpos can be cut. If yes, return 1 and |
| | 29 | * store it in the cut list of dragons.c. |
| | 30 | */ |
| | 31 | int |
| | 32 | disconnect_helper(int apos, int bpos) |
| | 33 | { |
| | 34 | int color = board[apos]; |
| | 35 | int move; |
| | 36 | ASSERT1(color == board[bpos] && IS_STONE(color), apos); |
| | 37 | |
| | 38 | if (dragon[apos].origin == dragon[bpos].origin) |
| | 39 | return 1; |
| | 40 | |
| | 41 | if (disconnect(apos, bpos, &move)) { |
| | 42 | add_cut(apos, bpos, move); |
| | 43 | return 1; |
| | 44 | } |
| | 45 | return 0; |
| | 46 | } |
| | 47 | |
| 28 | 48 | /* Try to match all (permutations of) connection patterns at (m,n). |
| 29 | 49 | * For each match, if it is a B pattern, set cutting point in |
| 30 | 50 | * cutting_points array. If it is a C pattern, amalgamate the dragons |
RCS file: /home/arend/Go/gnugo-rsync/gnugo/patterns/patterns.h,v
retrieving revision 1.73
diff -u -p -r1.73 patterns.h
|
|
|
|
| 325 | 325 | int adjacent_to_defendable_stone_in_atari(int str); |
| 326 | 326 | void backfill_replace(int move, int str); |
| 327 | 327 | int break_mirror_helper(int str, int color); |
| | 328 | int disconnect_helper(int apos, int bpos); |
| 328 | 329 | |
| 329 | 330 | |
| 330 | 331 | /* pattern arrays themselves */ |