shithub: puzzles

Download patch

ref: f39681ab41d60418c4a25270635a88d9cd0a685f
parent: d31eff148322ded1add98043854a5e5a5f48529f
author: Simon Tatham <anakin@pobox.com>
date: Tue Jan 13 14:31:29 EST 2015

Revise the Flood preset list.

The ones I started with were a bit under-varied and over-orthogonal.
Get rid of some of the more pointless things like 16x16 with lots of
extra moves, and add some with different colour counts. While I'm
here, make the menu descriptions nicer.

--- a/flood.c
+++ b/flood.c
@@ -80,30 +80,36 @@
     return ret;
 }
 
-static const struct game_params flood_presets[] = {
-    {12, 12, 6, 5},
-    {12, 12, 6, 2},
-    {12, 12, 6, 0},
-    {16, 16, 6, 5},
-    {16, 16, 6, 2},
-    {16, 16, 6, 0},
+static const struct {
+    struct game_params preset;
+    const char *name;
+} flood_presets[] = {
+    /* Default 12x12 size, three difficulty levels. */
+    {{12, 12, 6, 5}, "12x12 Easy"},
+    {{12, 12, 6, 2}, "12x12 Medium"},
+    {{12, 12, 6, 0}, "12x12 Hard"},
+    /* Larger puzzles, leaving off Easy in the expectation that people
+     * wanting a bigger grid will have played it enough to find Easy
+     * easy. */
+    {{16, 16, 6, 2}, "16x16 Medium"},
+    {{16, 16, 6, 0}, "16x16 Hard"},
+    /* A couple of different colour counts. It seems generally not too
+     * hard with fewer colours (probably because fewer choices), so no
+     * extra moves for these modes. */
+    {{12, 12, 3, 0}, "12x12, 3 colours"},
+    {{12, 12, 4, 0}, "12x12, 4 colours"},
 };
 
 static int game_fetch_preset(int i, char **name, game_params **params)
 {
     game_params *ret;
-    char str[80];
 
     if (i < 0 || i >= lenof(flood_presets))
         return FALSE;
 
     ret = snew(game_params);
-    *ret = flood_presets[i];
-
-    sprintf(str, "%dx%d, %d colours, %d extra moves",
-            ret->w, ret->h, ret->colours, ret->leniency);
-
-    *name = dupstr(str);
+    *ret = flood_presets[i].preset;
+    *name = dupstr(flood_presets[i].name);
     *params = ret;
     return TRUE;
 }