si = sy*w+sx; ei = ey*w+ex;
makelink(ret, si, ei);
} else if (sscanf(move, "%c%d,%d", &c, &sx, &sy) == 3) {
+ int sset;
+
if (c != 'C' && c != 'X') return NULL;
if (!INGRID(state, sx, sy)) return NULL;
si = sy*w+sx;
ret = dup_game(state);
- if (c == 'C') {
+ sset = state->nums[si] / (state->n+1);
+ if (c == 'C' || (c == 'X' && sset == 0)) {
/* Unlink the single cell we dragged from the board. */
unlink_cell(ret, si);
} else {
- int i, set, sset = state->nums[si] / (state->n+1);
+ int i, set;
for (i = 0; i < state->n; i++) {
/* Unlink all cells in the same set as the one we dragged
* from the board. */
/* Draw an arrow pointing away from/towards the origin cell. */
int ox = COORD(ui->sx) + TILE_SIZE/2, oy = COORD(ui->sy) + TILE_SIZE/2;
double tana, offset;
- double xdiff = fabs(ox - ui->dx), ydiff = fabs(oy - ui->dy);
+ double xdiff = abs(ox - ui->dx), ydiff = abs(oy - ui->dy);
if (xdiff == 0) {
ang = (oy > ui->dy) ? 0.0F : PI;
}
}
- sprintf(newseed, "%lu", time(NULL));
+ sprintf(newseed, "%lu", (unsigned long) time(NULL));
seedstr = dupstr(newseed);
if (id || !stdin_desc) {