diff options
| author | Simon Tatham <anakin@pobox.com> | 2005-05-02 13:17:10 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2005-05-02 13:17:10 +0000 |
| commit | 4f7b65de2e5f6387a819dd3767f5459b06f5db11 (patch) | |
| tree | cae01c5919854fcbbffae43de6032fc50ae5c031 /nullgame.c | |
| parent | aea7b6181580df2f0b28d027832dee8d9abccd73 (diff) | |
| download | puzzles-4f7b65de2e5f6387a819dd3767f5459b06f5db11.zip puzzles-4f7b65de2e5f6387a819dd3767f5459b06f5db11.tar.gz puzzles-4f7b65de2e5f6387a819dd3767f5459b06f5db11.tar.bz2 puzzles-4f7b65de2e5f6387a819dd3767f5459b06f5db11.tar.xz | |
Added an automatic `Solve' feature to most games. This is useful for
various things:
- if you haven't fully understood what a game is about, it gives
you an immediate example of a puzzle plus its solution so you can
understand it
- in some games it's useful to compare your solution with the real
one and see where you made a mistake
- in the rearrangement games (Fifteen, Sixteen, Twiddle) it's handy
to be able to get your hands on a pristine grid quickly so you
can practise or experiment with manoeuvres on it
- it provides a good way of debugging the games if you think you've
encountered an unsolvable grid!
[originally from svn r5731]
Diffstat (limited to 'nullgame.c')
| -rw-r--r-- | nullgame.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -94,7 +94,7 @@ static char *new_game_seed(game_params *params, random_state *rs, return dupstr("FIXME"); } -void game_free_aux_info(game_aux_info *aux) +static void game_free_aux_info(game_aux_info *aux) { assert(!"Shouldn't happen"); } @@ -127,6 +127,12 @@ static void free_game(game_state *state) sfree(state); } +static game_state *solve_game(game_state *state, game_aux_info *aux, + char **error) +{ + return NULL; +} + static char *game_text_format(game_state *state) { return NULL; @@ -234,6 +240,7 @@ const struct game thegame = { new_game, dup_game, free_game, + FALSE, solve_game, FALSE, game_text_format, new_ui, free_ui, |