X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/blobdiff_plain/ac9f41c4c8ccbf9364a5d351e4cb134812a9926b..b63898fe13e34da868c47c7a130d7b3eae74ebf4:/blackbox.c diff --git a/blackbox.c b/blackbox.c index 835175d..a8c6d5a 100644 --- a/blackbox.c +++ b/blackbox.c @@ -463,6 +463,11 @@ static char *solve_game(game_state *state, game_state *currstate, return dupstr("S"); } +static int game_can_format_as_text_now(game_params *params) +{ + return TRUE; +} + static char *game_text_format(game_state *state) { return NULL; @@ -813,7 +818,9 @@ static int check_guesses(game_state *state, int cagey) ret = 0; } } - if (ret == 0) goto done; + if (ret == 0 || + state->nguesses < state->minballs || + state->nguesses > state->maxballs) goto done; /* fix up original state so the 'correct' balls end up matching the guesses, * as we've just proved that they were equivalent. */ @@ -1396,7 +1403,7 @@ static void game_print(drawing *dr, game_state *state, int tilesize) #endif const struct game thegame = { - "Black Box", "games.blackbox", + "Black Box", "games.blackbox", "blackbox", default_params, game_fetch_preset, decode_params, @@ -1411,7 +1418,7 @@ const struct game thegame = { dup_game, free_game, TRUE, solve_game, - FALSE, game_text_format, + FALSE, game_can_format_as_text_now, game_text_format, new_ui, free_ui, encode_ui, @@ -1429,7 +1436,7 @@ const struct game thegame = { FALSE, FALSE, game_print_size, game_print, TRUE, /* wants_statusbar */ FALSE, game_timing_state, - 0, /* flags */ + REQUIRE_RBUTTON, /* flags */ }; /* vim: set shiftwidth=4 tabstop=8: */