diff --git a/engine/liberty.h b/engine/liberty.h
index 416cd29..7eb1d6b 100644
|
a
|
b
|
void add_expand_moyo_move(int pos); |
| 386 | 386 | void add_strategical_attack_move(int pos, int dr); |
| 387 | 387 | void add_strategical_defense_move(int pos, int dr); |
| 388 | 388 | void add_worthwhile_threat_move(int pos); |
| 389 | | void add_replacement_move(int from, int to); |
| | 389 | void add_replacement_move(int from, int to, int color); |
| 390 | 390 | |
| 391 | 391 | /* Parameters to add_either_move and add_all_move */ |
| 392 | 392 | #define ATTACK_STRING 1 |
diff --git a/engine/move_reasons.c b/engine/move_reasons.c
index 8d8c24e..36c8c90 100644
|
a
|
b
|
set_maximum_territorial_value(int pos, float value) |
| 1352 | 1352 | * to (to). |
| 1353 | 1353 | */ |
| 1354 | 1354 | void |
| 1355 | | add_replacement_move(int from, int to) |
| | 1355 | add_replacement_move(int from, int to, int color) |
| 1356 | 1356 | { |
| 1357 | 1357 | int cc; |
| 1358 | 1358 | int pos; |
| | 1359 | int dummy; |
| 1359 | 1360 | |
| 1360 | 1361 | ASSERT_ON_BOARD1(from); |
| 1361 | 1362 | ASSERT_ON_BOARD1(to); |
| … |
… |
add_replacement_move(int from, int to) |
| 1365 | 1366 | ASSERT1(board[to] == EMPTY, to); |
| 1366 | 1367 | |
| 1367 | 1368 | cc = replacement_map[to]; |
| | 1369 | if (unconditionally_meaningless_move(to, color, &dummy)) { |
| | 1370 | /* Silently ignore replacement patterns which conflict with the |
| | 1371 | * unconditional analysis since the latter is always correct and |
| | 1372 | * it's difficult to anticipate such situations for the patterns. |
| | 1373 | */ |
| | 1374 | return; |
| | 1375 | } |
| 1368 | 1376 | |
| 1369 | 1377 | /* First check for an incompatible redistribution rule. */ |
| 1370 | 1378 | if (replacement_map[from] != NO_MOVE) { |
diff --git a/engine/unconditional.c b/engine/unconditional.c
index 54d5638..3640ed9 100644
|
a
|
b
|
unconditional_move_reasons(int color) |
| 692 | 692 | } |
| 693 | 693 | else { |
| 694 | 694 | TRACE("%1m unconditionally replaced to %1m.\n", pos, replacement_move); |
| 695 | | add_replacement_move(pos, replacement_move); |
| | 695 | add_replacement_move(pos, replacement_move, color); |
| 696 | 696 | } |
| 697 | 697 | } |
| 698 | 698 | } |
diff --git a/patterns/helpers.c b/patterns/helpers.c
index 85f606e..1938af8 100644
|
a
|
b
|
backfill_replace(int move, int str) |
| 738 | 738 | if (attack_and_defend(str, NULL, NULL, NULL, &defense_move)) { |
| 739 | 739 | /* Must undo the trymove before adding the replacement move. */ |
| 740 | 740 | popgo(); |
| 741 | | add_replacement_move(move, defense_move); |
| | 741 | add_replacement_move(move, defense_move, board[str]); |
| 742 | 742 | } |
| 743 | 743 | else |
| 744 | 744 | popgo(); |
diff --git a/patterns/mkpat.c b/patterns/mkpat.c
index 2a90abd..83ececd 100644
|
a
|
b
|
static struct autohelper_func autohelper_functions[] = { |
| 411 | 411 | "connect_and_cut_helper2(%s, %s, %s, color)"}, |
| 412 | 412 | {"connect_and_cut_helper", 3, 0, 3.00, "connect_and_cut_helper(%s, %s, %s)"}, |
| 413 | 413 | {"owl_threatens", 2, 0, 0.01, "owl_threatens_attack(%s, %s)"}, |
| 414 | | {"replace", 2, 0, 0.0, "add_replacement_move(%s, %s)"}, |
| | 414 | {"replace", 2, 0, 0.0, "add_replacement_move(%s, %s, color)"}, |
| 415 | 415 | {"backfill_replace", 2, 0, 0.0, "backfill_replace(%s, %s)"}, |
| 416 | 416 | {"non_oterritory", 1, 0, 0.0, |
| 417 | 417 | "influence_mark_non_territory(%s, color)"}, |