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 /puzzles.h | |
| 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 'puzzles.h')
| -rw-r--r-- | puzzles.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -142,6 +142,7 @@ config_item *midend_get_config(midend_data *me, int which, char **wintitle); char *midend_set_config(midend_data *me, int which, config_item *cfg); char *midend_game_id(midend_data *me, char *id, int def_seed); char *midend_text_format(midend_data *me); +char *midend_solve(midend_data *me); /* * malloc.c @@ -197,6 +198,8 @@ struct game { game_state *(*new_game)(game_params *params, char *seed); game_state *(*dup_game)(game_state *state); void (*free_game)(game_state *state); + int can_solve; + game_state *(*solve)(game_state *state, game_aux_info *aux, char **error); int can_format_as_text; char *(*text_format)(game_state *state); game_ui *(*new_ui)(game_state *state); |