Fix outdated comment
[sgt/puzzles] / twiddle.c
index 8a389b4..8fd0b21 100644 (file)
--- a/twiddle.c
+++ b/twiddle.c
@@ -317,7 +317,7 @@ static char *new_game_seed(game_params *params, random_state *rs,
      * and simply shuffle the grid by making a long sequence of
      * randomly chosen moves.
      */
-    total_moves = w*h*n*n*2;
+    total_moves = w*h*n*n*2 + random_upto(rs, 1);
     for (i = 0; i < total_moves; i++) {
        int x, y;
 
@@ -479,6 +479,7 @@ static game_state *solve_game(game_state *state, game_aux_info *aux,
                              char **error)
 {
     game_state *ret = dup_game(state);
+    int i;
 
     /*
      * Simply replace the grid with a solved one. For this game,
@@ -488,6 +489,8 @@ static game_state *solve_game(game_state *state, game_aux_info *aux,
      * which to practise manoeuvres.
      */
     qsort(ret->grid, ret->w*ret->h, sizeof(int), compare_int);
+    for (i = 0; i < ret->w*ret->h; i++)
+       ret->grid[i] &= ~3;
     ret->used_solve = ret->just_used_solve = TRUE;
     ret->completed = ret->movecount;
 
@@ -518,7 +521,7 @@ static char *game_text_format(game_state *state)
      */
     maxlen = state->h * state->w * (col+o+1);
 
-    ret = snewn(maxlen, char);
+    ret = snewn(maxlen+1, char);
     p = ret;
 
     for (y = 0; y < state->h; y++) {
@@ -760,7 +763,7 @@ static void draw_tile(frontend *fe, game_state *state, int x, int y,
     }
 
     /*
-     * Next, the colour bars for orientation.
+     * Next, the triangles for orientation.
      */
     if (state->orientable) {
        int xdx, xdy, ydx, ydy;