Ticket #145: move_reasons.c.patch

File move_reasons.c.patch, 2.5 kB (added by draqo, 2 years ago)
  • gnugo/engine/move_reasons.c

    RCS file: /sources/gnugo/gnugo/engine/move_reasons.c,v
    retrieving revision 1.135
    diff -u -r1.135 move_reasons.c
     
    100100  next_eye = 0; 
    101101  next_lunch = 0; 
    102102   
    103   for (pos = BOARDMIN; pos < BOARDMAX; pos++) { 
    104     if (ON_BOARD(pos)) { 
     103  scan_board(pos, 
    105104      move[pos].value                    = 0.0; 
    106105      move[pos].final_value              = 0.0; 
    107106      move[pos].additional_ko_value      = 0.0; 
     
    134133 
    135134      /* Do not send away the points (yet). */ 
    136135      replacement_map[pos] = NO_MOVE; 
    137     } 
    138   } 
     136  ) 
    139137 
    140   for (pos = BOARDMIN; pos < BOARDMAX; pos++) { 
     138  scan_board(pos, 
    141139    for (k = 0; k < MAX_ATTACK_THREATS; k++) 
    142140      known_good_attack_threats[pos][k] = NO_MOVE; 
    143   } 
     141  ) 
    144142} 
    145143 
    146144 
     
    13911389  else 
    13921390    replacement_map[from] = to; 
    13931391   
    1394   for (pos = BOARDMIN; pos < BOARDMAX; pos++) { 
    1395     if (ON_BOARD(pos) && replacement_map[pos] == from) 
     1392  scan_board(pos, 
     1393    if (replacement_map[pos] == from) 
    13961394      replacement_map[pos] = replacement_map[from]; 
    1397   } 
     1395  ) 
    13981396} 
    13991397 
    14001398 
     
    14231421      int origin = dragon[what].origin; 
    14241422      int kworm = worm[what].origin; 
    14251423      int ii; 
    1426       for (ii = BOARDMIN; ii < BOARDMAX; ii++) 
    1427         if (IS_STONE(board[ii]) && dragon[ii].origin == origin 
    1428             && worm[ii].origin != kworm) 
    1429           mark_string(worm[ii].origin, saved, 1); 
    1430     } 
     1424      scan_board(ii, 
     1425            if (IS_STONE(board[ii]) && dragon[ii].origin == origin 
     1426                && worm[ii].origin != kworm) 
     1427              mark_string(worm[ii].origin, saved, 1); 
     1428          ) 
     1429        } 
    14311430  }     
    14321431} 
    14331432 
     
    15621561    gg_assert(new_status == INFLUENCE_SAVED_STONE); 
    15631562    new_strength = DEFAULT_STRENGTH; 
    15641563  } 
    1565   for (ii = BOARDMIN; ii < BOARDMAX; ii++) 
     1564  scan_board(ii, 
    15661565    if (board[ii] == board[affected] 
    15671566        && same_string(ii, affected)) { 
    15681567      strength[ii] = new_strength; 
    15691568      safe_stones[ii] = new_status; 
    15701569    } 
     1570  ) 
    15711571} 
    15721572 
    15731573 
     
    16111611{ 
    16121612  int pos;  
    16131613 
    1614   for (pos = BOARDMIN; pos < BOARDMAX; pos++) { 
     1614  scan_board(pos, 
    16151615    if (board[pos] == OTHER_COLOR(color)) { 
    16161616      if (dragon[pos].status == DEAD 
    16171617          || (worm[pos].attack_codes[0] != 0 
     
    16341634    } 
    16351635    else 
    16361636      safe_stones[pos] = 0; 
    1637   } 
     1637  ) 
    16381638  safe_stones[move_pos] 
    16391639    = move[move_pos].move_safety && safe_move(move_pos, color) == WIN; 
    16401640}