RCS file: /sources/gnugo/gnugo/engine/semeai.c,v
retrieving revision 1.79
diff -u -r1.79 semeai.c
|
|
|
|
| 244 | 244 | int defend_move; |
| 245 | 245 | int resulta, resultb; |
| 246 | 246 | |
| 247 | | for (str = BOARDMIN; str < BOARDMAX; str++) { |
| | 247 | scan_board(str, |
| 248 | 248 | if (IS_STONE(board[str]) && is_worm_origin(str, str) |
| 249 | 249 | && attack_and_defend(str, NULL, NULL, NULL, &defend_move) |
| 250 | 250 | && dragon[str].status == DEAD |
| … |
… |
|
| 338 | 338 | dragon2[d].semeai_attack_target = opponent; |
| 339 | 339 | } |
| 340 | 340 | } |
| 341 | | } |
| | 341 | ) |
| 342 | 342 | |
| 343 | 343 | /* Now look for dead strings inside a single eyespace of a living dragon. |
| 344 | 344 | * |
| … |
… |
|
| 347 | 347 | * moves invading a previously empty single eyespace to make |
| 348 | 348 | * seki can be found. |
| 349 | 349 | */ |
| 350 | | for (str = BOARDMIN; str < BOARDMAX; str++) { |
| | 350 | scan_board(str, |
| 351 | 351 | if (IS_STONE(board[str]) && is_worm_origin(str, str) |
| 352 | 352 | && !find_defense(str, NULL) |
| 353 | 353 | && dragon[str].status == DEAD |
| … |
… |
|
| 441 | 441 | dragon2[d].semeai_attack_target = opponent; |
| 442 | 442 | } |
| 443 | 443 | } |
| 444 | | } |
| | 444 | ) |
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | |
| … |
… |
|
| 469 | 469 | close_enough_for_proper_semeai(int apos, int bpos) |
| 470 | 470 | { |
| 471 | 471 | int pos; |
| 472 | | for (pos = BOARDMIN; pos < BOARDMAX; pos++) { |
| | 472 | scan_board(pos, |
| 473 | 473 | if (board[pos] == EMPTY |
| 474 | 474 | && neighbor_of_dragon(pos, apos) |
| 475 | 475 | && neighbor_of_dragon(pos, bpos)) |
| … |
… |
|
| 480 | 480 | if (is_same_dragon(pos, bpos) && neighbor_of_dragon(pos, apos)) |
| 481 | 481 | return 1; |
| 482 | 482 | } |
| 483 | | } |
| | 483 | ) |
| 484 | 484 | |
| 485 | 485 | return 0; |
| 486 | 486 | } |
| … |
… |
|
| 579 | 579 | DEBUG(DEBUG_SEMEAI, "Changing status of %1m from %s to %s.\n", dr, |
| 580 | 580 | status_to_string(dragon[dr].status), |
| 581 | 581 | status_to_string(new_status)); |
| 582 | | for (pos = BOARDMIN; pos < BOARDMAX; pos++) |
| | 582 | scan_board(pos, |
| 583 | 583 | if (IS_STONE(board[pos]) && is_same_dragon(dr, pos)) { |
| 584 | 584 | dragon[pos].status = new_status; |
| 585 | 585 | if (new_status != DEAD) |
| 586 | 586 | worm[pos].inessential = 0; |
| 587 | | } |
| | 587 | } |
| | 588 | ) |
| 588 | 589 | } |
| 589 | 590 | |
| 590 | 591 | if (DRAGON2(dr).safety != new_safety |