X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/blobdiff_plain/1f3ee4ee0f9443910671f5e57837fa5311000b21..6dae1679977511f3dc97a15e558fc23b4d796012:/mines.c diff --git a/mines.c b/mines.c index e888224..f3e216c 100644 --- a/mines.c +++ b/mines.c @@ -237,7 +237,7 @@ static game_params *custom_params(config_item *cfg) return ret; } -static char *validate_params(game_params *params) +static char *validate_params(game_params *params, int full) { /* * Lower limit on grid size: each dimension must be at least 3. @@ -253,7 +253,7 @@ static char *validate_params(game_params *params) * _have_ to have a gap somewhere which you can't determine the * position of. */ - if (params->w <= 2 || params->h <= 2) + if (full && params->unique && (params->w <= 2 || params->h <= 2)) return "Width and height must both be greater than two"; if (params->n > params->w * params->h - 9) return "Too many mines for grid size"; @@ -3070,7 +3070,7 @@ const struct game thegame = { * $ ./mineobfusc 9x9:4,4,004000007c00010022080 * 9x9:4,4,mb071b49fbd1cb6a0d5868 * - * gcc -DSTANDALONE_OBFUSCATOR -o mineobfusc mines.c malloc.c random.c tree234.c + * gcc -DSTANDALONE_OBFUSCATOR -o mineobfusc mines.c malloc.c random.c tree234.c misc.c */ #include @@ -3087,7 +3087,7 @@ void unclip(frontend *fe) {} void start_draw(frontend *fe) {} void draw_update(frontend *fe, int x, int y, int w, int h) {} void end_draw(frontend *fe) {} -void midend_supersede_game_desc(midend_data *me, char *desc) {} +void midend_supersede_game_desc(midend_data *me, char *desc, char *privdesc) {} void status_bar(frontend *fe, char *text) {} void fatal(char *fmt, ...) @@ -3108,15 +3108,13 @@ int main(int argc, char **argv) { game_params *p; game_state *s; - int recurse = TRUE; char *id = NULL, *desc, *err; int y, x; - int grade = FALSE; while (--argc > 0) { char *p = *++argv; if (*p == '-') { - fprintf(stderr, "%s: unrecognised option `%s'\n", argv[0]); + fprintf(stderr, "%s: unrecognised option `%s'\n", argv[0], p); return 1; } else { id = p;