Ticket #75: arend_7_9.4.diff

File arend_7_9.4.diff, 6.6 kB (added by arend, 3 years ago)
  • engine/dragon.c

    RCS file: /home/arend/Go/gnugo-rsync/gnugo/engine/dragon.c,v
    retrieving revision 1.158
    diff -u -p -r1.158 dragon.c
     
    7070static int compute_crude_status(int pos); 
    7171static int compute_escape(int pos, int dragon_status_known); 
    7272static void compute_surrounding_moyo_sizes(const struct influence_data *q); 
     73static void clear_cut_list(void); 
    7374 
    7475static int dragon2_initialized; 
    7576static int lively_white_dragons; 
     
    663664   */ 
    664665  number_of_dragons = 0; 
    665666 
     667  clear_cut_list(); 
     668 
    666669  memset(black_vital_points, 0, BOARDMAX * sizeof(struct vital_eye_points)); 
    667670  memset(white_vital_points, 0, BOARDMAX * sizeof(struct vital_eye_points)); 
    668671} 
     
    23702373} 
    23712374 
    23722375 
     2376/************************************************************************ 
     2377 *         A list of all cuts found during connection matching          * 
     2378 ************************************************************************/ 
     2379 
     2380#define MAX_CUTS        3 * MAX_BOARD * MAX_BOARD 
     2381 
     2382struct cut_data { 
     2383  int a; 
     2384  int b; 
     2385  int move; 
     2386}; 
     2387 
     2388static int num_cuts = 0; 
     2389static struct cut_data cut_list[MAX_CUTS]; 
     2390 
     2391static void 
     2392clear_cut_list() 
     2393{ 
     2394  num_cuts = 0; 
     2395} 
     2396 
     2397void 
     2398add_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 
     2419void 
     2420cut_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 
    23732430 
    23742431/* ================================================================ */ 
    23752432/*                      Debugger functions                          */ 
  • engine/genmove.c

    RCS file: /home/arend/Go/gnugo-rsync/gnugo/engine/genmove.c,v
    retrieving revision 1.112
    diff -u -p -r1.112 genmove.c
     
    278278  worm_reasons(color); 
    279279  semeai_move_reasons(color); 
    280280  owl_reasons(color); 
     281  cut_reasons(color); 
    281282  break_in_move_reasons(color); 
    282283} 
    283284 
  • engine/liberty.h

    RCS file: /home/arend/Go/gnugo-rsync/gnugo/engine/liberty.h,v
    retrieving revision 1.252
    diff -u -p -r1.252 liberty.h
     
    323323                       float strength[BOARDMAX]); 
    324324void mark_inessential_stones(int color, signed char safe_stones[BOARDMAX]); 
    325325 
     326void add_cut(int apos, int bpos, int move); 
     327void cut_reasons(int color); 
     328 
    326329void get_lively_stones(int color, signed char safe_stones[BOARDMAX]); 
    327330int is_same_worm(int w1, int w2); 
    328331int is_worm_origin(int w, int pos); 
  • patterns/conn.db

    RCS file: /home/arend/Go/gnugo-rsync/gnugo/patterns/conn.db,v
    retrieving revision 1.43
    diff -u -p -r1.43 conn.db
     
    585585a 
    586586b 
    587587 
    588 ;!xcut(a) && !oplay_disconnect(b,c) 
     588;!xcut(a) && !disconnect_helper(b,c) 
    589589 
    590590 
    591591Pattern CC504 
     
    598598Xb 
    599599ca 
    600600 
    601 ;!xcut(a) && !oplay_disconnect(b,c) 
     601;!xcut(a) && !disconnect_helper(b,c) 
    602602 
    603603 
    604604Pattern CC505 
     
    611611Bc 
    612612dA 
    613613 
    614 ;(attack(A) || attack(B)) && !oplay_disconnect(c,d) 
     614;(attack(A) || attack(B)) && !disconnect_helper(c,d) 
    615615 
    616616 
    617617Pattern CC506 
     
    628628b 
    629629d 
    630630 
    631 ;!xcut(a) && !xcut(b) && !oplay_disconnect(c,d) 
     631;!xcut(a) && !xcut(b) && !disconnect_helper(c,d) 
    632632 
    633633 
    634634Pattern CC506b 
     
    645645ab 
    646646d. 
    647647 
    648 ;!xcut(a) && !xcut(b) && lib(E)<=2 && !oplay_disconnect(c,d) 
     648;!xcut(a) && !xcut(b) && lib(E)<=2 && !disconnect_helper(c,d) 
    649649 
    650650 
    651651Pattern CC507 
     
    660660ab 
    661661xd 
    662662 
    663 ;!xcut(a) && !xcut(b) && !oplay_disconnect(c,d) 
     663;!xcut(a) && !xcut(b) && !disconnect_helper(c,d) 
    664664 
    665665 
    666666Pattern CC508 
     
    675675aX 
    676676xc 
    677677 
    678 ;!xcut(a) && !oplay_disconnect(b,c) 
     678;!xcut(a) && !disconnect_helper(b,c) 
    679679 
    680680 
    681681Pattern CC509 
     
    692692cd 
    693693xf 
    694694 
    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) 
    696696 
    697697 
    698698Pattern CC511 
  • patterns/connections.c

    RCS file: /home/arend/Go/gnugo-rsync/gnugo/patterns/connections.c,v
    retrieving revision 1.44
    diff -u -p -r1.44 connections.c
     
    2525#include "patterns.h" 
    2626 
    2727 
     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 */ 
     31int 
     32disconnect_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 
    2848/* Try to match all (permutations of) connection patterns at (m,n). 
    2949 * For each match, if it is a B pattern, set cutting point in 
    3050 * cutting_points array. If it is a C pattern, amalgamate the dragons 
  • patterns/patterns.h

    RCS file: /home/arend/Go/gnugo-rsync/gnugo/patterns/patterns.h,v
    retrieving revision 1.73
    diff -u -p -r1.73 patterns.h
     
    325325int adjacent_to_defendable_stone_in_atari(int str); 
    326326void backfill_replace(int move, int str); 
    327327int break_mirror_helper(int str, int color); 
     328int disconnect_helper(int apos, int bpos); 
    328329 
    329330 
    330331/* pattern arrays themselves */