Example #1
0
static bool
can_play_on_lib(struct board *b, group_t g, enum stone to_play)
{
    coord_t capture = board_group_info(b, g).lib[0];
    if (DEBUGL(6))
        fprintf(stderr, "can capture group %d (%s)?\n",
                g, coord2sstr(capture, b));
    /* Does playing on the liberty usefully capture the group? */
    if (board_is_valid_play(b, to_play, capture)
            && !is_bad_selfatari(b, to_play, capture))
        return true;

    return false;
}
Example #2
0
static coord_t *
proof_genmove(struct engine *e, struct board *b, struct time_info *ti, enum stone color, bool pass_all_alive)
{
    coord_t *coord;
    fprintf(stderr, "HELLO WORLD!");
    struct board b2;
    board_copy(&b2, b);
    for (int i=0; i<=19; i++){
        for (int j=0; j<=19; j++){
            coord = coord_init(i,j,board_size(&b2));
            if (board_is_valid_play(&b2, color, *coord))
                return coord;
        }
    }
    *coord = -1;
    return coord;
}