in pachi_py/pachi/tactics/selfatari.c [368:400]
do if (!atariing_group && !cap_would_make_eye && s->groupcts[color] == 1)
{
board_copy(&b2, b);
/* Play opponent color where we want to play */
m.coord = to;
m.color = stone_other(color);
if (board_play(&b2, &m) == -1) /* Illegal move (eye ...) */
{ board_done_noalloc(&b2); break; }
/* Had 2 libs ? One more move to capture us then */
if (neighbor_count_at(b, to, color) == neighbor_count_at(&b2, to, color)) {
group_t standing = -1;
foreach_neighbor(&b2, to, {
g = group_at(&b2, c);
if (board_at(&b2, c) == color) {
assert(board_group_info(&b2, g).libs == 1); /* Should be in atari */
standing = g;
}
});
assert(standing != -1);
m.coord = board_group_info(&b2, standing).lib[0];
r = board_play(&b2, &m); assert(r != -1);
}
/* Empty now since it's been captured */
coord_t empty = group_base(s->groupids[color][0]);
int would_live = !nakade_dead_shape(&b2, empty, stone_other(color));
board_done_noalloc(&b2);
if (!would_live) /* And !cap_would_make_eye here */
return false; /* Bad nakade */
} while (0);