X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/blobdiff_plain/dafd6cf6826f9bbd27ddd780fab48221d4706556..e4b6a85b3c76d4002feff93c0dc268366192f906:/puzzles.h diff --git a/puzzles.h b/puzzles.h index 007dfee..a962bc3 100644 --- a/puzzles.h +++ b/puzzles.h @@ -204,6 +204,7 @@ midend *midend_new(frontend *fe, const game *ourgame, const drawing_api *drapi, void *drhandle); void midend_free(midend *me); void midend_set_params(midend *me, game_params *params); +game_params *midend_get_params(midend *me); void midend_size(midend *me, int *x, int *y, int expand); void midend_new_game(midend *me); void midend_restart_game(midend *me); @@ -217,7 +218,7 @@ int midend_num_presets(midend *me); void midend_fetch_preset(midend *me, int n, char **name, game_params **params); int midend_wants_statusbar(midend *me); -enum { CFG_SETTINGS, CFG_SEED, CFG_DESC }; +enum { CFG_SETTINGS, CFG_SEED, CFG_DESC, CFG_FRONTEND_SPECIFIC }; config_item *midend_get_config(midend *me, int which, char **wintitle); char *midend_set_config(midend *me, int which, config_item *cfg); char *midend_game_id(midend *me, char *id); @@ -323,6 +324,20 @@ void ps_free(psdata *ps); drawing *ps_drawing_api(psdata *ps); /* + * combi.c: provides a structure and functions for iterating over + * combinations (i.e. choosing r things out of n). + */ +typedef struct _combi_ctx { + int r, n, nleft, total; + int *a; +} combi_ctx; + +combi_ctx *new_combi(int r, int n); +void reset_combi(combi_ctx *combi); +combi_ctx *next_combi(combi_ctx *combi); /* returns NULL for end */ +void free_combi(combi_ctx *combi); + +/* * Data structure containing the function calls and data specific * to a particular game. This is enclosed in a data structure so * that a particular platform can choose, if it wishes, to compile