338 |
* The name saved_stones is historic and should probably be changed |
* The name saved_stones is historic and should probably be changed |
339 |
* since it also includes captured stones. |
* since it also includes captured stones. |
340 |
* |
* |
|
* The relative strength for inessential stones must be somewhat |
|
|
* larger than 0. Otherwise they may be considered as territory for |
|
|
* the opponent and the territory evaluations may mess up. |
|
341 |
*/ |
*/ |
342 |
|
|
343 |
static float strength_map[10] = { |
static float strength_map[10] = { |
344 |
0.0, /* DEAD */ |
0.0, /* DEAD */ |
345 |
0.9, /* ALIVE */ |
0.9, /* ALIVE */ |
346 |
0.5, /* CRITICAL */ |
0.5, /* CRITICAL */ |
347 |
0.01, /* INESSENTIAL */ |
0.0, /* INESSENTIAL */ |
348 |
0.0, /* TACTICALLY DEAD */ |
0.0, /* TACTICALLY DEAD */ |
349 |
0.7, /* WEAK */ |
0.7, /* WEAK */ |
350 |
0.8, /* WEAKLY_ALIVE */ |
0.8, /* WEAKLY_ALIVE */ |
442 |
if (IS_STONE(board[pos]) |
if (IS_STONE(board[pos]) |
443 |
&& dragons_known |
&& dragons_known |
444 |
&& dragon[pos].id != -1 |
&& dragon[pos].id != -1 |
445 |
&& DRAGON2(pos).safety == INESSENTIAL |
&& (DRAGON2(pos).safety == INESSENTIAL |
446 |
|
|| (worm[pos].inessential |
447 |
|
&& ((DRAGON2(pos).safety != DEAD |
448 |
|
&& DRAGON2(pos).safety != CRITICAL) |
449 |
|
|| (DRAGON2(pos).safety == CRITICAL |
450 |
|
&& board[pos] == color)))) |
451 |
&& q->p[i][j] == EMPTY) |
&& q->p[i][j] == EMPTY) |
452 |
q->p[i][j] = board[pos]; |
q->p[i][j] = board[pos]; |
453 |
} |
} |
1281 |
for (j = 0; j < board_size; j++) { |
for (j = 0; j < board_size; j++) { |
1282 |
first_guess[i][j] = 0.0; |
first_guess[i][j] = 0.0; |
1283 |
|
|
1284 |
if (q->p[i][j] == EMPTY |
if (q->p[i][j] == EMPTY) { |
|
|| (q->black_strength[i][j] == 0 && q->white_strength[i][j] == 0)) { |
|
1285 |
float diff = 0.0; |
float diff = 0.0; |
1286 |
if (q->white_influence[i][j] + q->black_influence[i][j] > 0) |
if (q->white_influence[i][j] + q->black_influence[i][j] > 0) |
1287 |
diff = (q->white_influence[i][j] - q->black_influence[i][j]) |
diff = (q->white_influence[i][j] - q->black_influence[i][j]) |
1319 |
*/ |
*/ |
1320 |
for (i = 0; i < board_size; i++) |
for (i = 0; i < board_size; i++) |
1321 |
for (j = 0; j < board_size; j++) { |
for (j = 0; j < board_size; j++) { |
1322 |
/* Do not overrule dead stone territory above. */ |
/* Do not overrule dead stone territory above. |
1323 |
|
* FIXME: This does not do what it claims to do. Correcting it |
1324 |
|
* seems to break some tests, though. |
1325 |
|
*/ |
1326 |
if (q->p[i][j] == EMPTY) { |
if (q->p[i][j] == EMPTY) { |
1327 |
/* Loop over all neighbors. */ |
/* Loop over all neighbors. */ |
1328 |
for (k = 0; k < 4; k++) { |
for (k = 0; k < 4; k++) { |
1359 |
/* Third loop: Nonterritory patterns, points for prisoners. */ |
/* Third loop: Nonterritory patterns, points for prisoners. */ |
1360 |
for (i = 0; i < board_size; i++) |
for (i = 0; i < board_size; i++) |
1361 |
for (j = 0; j < board_size; j++) { |
for (j = 0; j < board_size; j++) { |
1362 |
if (q->p[i][j] == EMPTY |
if (q->p[i][j] == EMPTY) { |
|
|| (q->black_strength[i][j] == 0 && q->white_strength[i][j] == 0)) { |
|
1363 |
/* If marked as non-territory for the color currently owning |
/* If marked as non-territory for the color currently owning |
1364 |
* it, reset the territory value. |
* it, reset the territory value. |
1365 |
*/ |
*/ |