sfree(sstate->dot_atleastone);
sfree(sstate->dot_atmostone);
/* sfree(sstate->dline_identical); */
+ sfree(sstate->dotdsf);
+ sfree(sstate->looplen);
+ sfree(sstate);
}
}
static solver_state *dup_solver_state(solver_state *sstate) {
- game_state *state = dup_game(sstate->state);
+ game_state *state;
solver_state *ret = snew(solver_state);
- ret->state = dup_game(state);
+ ret->state = state = dup_game(sstate->state);
ret->dot_atmostone = snewn(DOT_COUNT(state), char);
memcpy(ret->dot_atmostone, sstate->dot_atmostone, DOT_COUNT(state));
{ "4x4 Easy", { 4, 4, 0 } },
{ "4x4 Hard", { 4, 4, 2 } },
{ "7x7 Easy", { 7, 7, 0 } },
- { "7x7 Hard", { 7, 7, 0 } },
+ { "7x7 Hard", { 7, 7, 2 } },
{ "10x10 Easy", { 10, 10, 0 } },
{ "10x10 Hard", { 10, 10, 2 } },
{ "15x15 Easy", { 15, 15, 0 } },
- { "20x30 Easy", { 20, 30, 0 } }
+ { "30x20 Easy", { 30, 20, 0 } }
};
static int game_fetch_preset(int i, char **name, game_params **params)
}
}
}
+ sfree(square);
/* printf("\n\n"); */
}
ret = saved_ret;
}
}
+ sfree(square_list);
return ret;
}
for (i = 0; i < params->w; ++i) {
if (CLUE_AT(state, i, j) == ' ') {
if (empty_count > 25) {
- dp += sprintf(dp, "%c", empty_count + 'a' - 1);
+ dp += sprintf(dp, "%c", (int)(empty_count + 'a' - 1));
empty_count = 0;
}
empty_count++;
} else {
if (empty_count) {
- dp += sprintf(dp, "%c", empty_count + 'a' - 1);
+ dp += sprintf(dp, "%c", (int)(empty_count + 'a' - 1));
empty_count = 0;
}
- dp += sprintf(dp, "%c", CLUE_AT(state, i, j));
+ dp += sprintf(dp, "%c", (int)(CLUE_AT(state, i, j)));
}
}
}
if (empty_count)
- dp += sprintf(dp, "%c", empty_count + 'a' - 1);
+ dp += sprintf(dp, "%c", (int)(empty_count + 'a' - 1));
- sfree(state);
+ free_game(state);
retval = dupstr(description);
sfree(description);
/* Sums the lengths of the numbers in range [0,n) */
/* See equivalent function in solo.c for justification of this. */
-int len_0_to_n(int n)
+static int len_0_to_n(int n)
{
int len = 1; /* Counting 0 as a bit of a special case */
int i;
/* No point in doing sums like that if they're going to be wrong */
assert(strlen(ret) <= (size_t)len);
- return dupstr(ret);
+ return ret;
}
/* BEGIN SOLVER IMPLEMENTATION */
rp += sprintf(rp, " \n");
for (i = 0; i < state->w; ++i) {
DRAW_VL;
- rp += sprintf(rp, "%c", CLUE_AT(state, i, j));
+ rp += sprintf(rp, "%c", (int)(CLUE_AT(state, i, j)));
}
DRAW_VL;
rp += sprintf(rp, "\n");
}
- sprintf(buf, "%d,%d%c%c", i, j, hl_selected ? 'h' : 'v', button_char);
+ sprintf(buf, "%d,%d%c%c", i, j, (int)(hl_selected ? 'h' : 'v'), (int)button_char);
ret = dupstr(buf);
return ret;
/*
* Check for completion.
*/
+ i = 0; /* placate optimiser */
for (j = 0; j <= newstate->h; j++) {
for (i = 0; i < newstate->w; i++)
if (LV_RIGHTOF_DOT(newstate, i, j) == LINE_YES)