~mdw
/
sgt
/
puzzles
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
solve_game() is passed the _initial_ game state, not the most recent
[sgt/puzzles]
/
fifteen.c
diff --git
a/fifteen.c
b/fifteen.c
index
c29e9fe
..
3aba7fa
100644
(file)
--- a/
fifteen.c
+++ b/
fifteen.c
@@
-398,7
+398,7
@@
static game_state *solve_game(game_state *state, game_aux_info *aux,
ret->tiles[i] = (i+1) % ret->n;
ret->gap_pos = ret->n-1;
ret->used_solve = ret->just_used_solve = TRUE;
ret->tiles[i] = (i+1) % ret->n;
ret->gap_pos = ret->n-1;
ret->used_solve = ret->just_used_solve = TRUE;
- ret->completed = ret->movecount;
+ ret->completed = ret->movecount
= 1
;
return ret;
}
return ret;
}
@@
-421,7
+421,7
@@
static char *game_text_format(game_state *state)
*/
maxlen = state->h * state->w * (col+1);
*/
maxlen = state->h * state->w * (col+1);
- ret = snewn(maxlen, char);
+ ret = snewn(maxlen
+1
, char);
p = ret;
for (y = 0; y < state->h; y++) {
p = ret;
for (y = 0; y < state->h; y++) {