2 * puzzles.h: header file for my puzzle collection
5 #ifndef PUZZLES_PUZZLES_H
6 #define PUZZLES_PUZZLES_H
8 #include <stdio.h> /* for FILE */
9 #include <stdlib.h> /* for size_t */
10 #include <limits.h> /* for UINT_MAX */
19 #define PI 3.141592653589793238462643383279502884197169399
21 #define lenof(array) ( sizeof(array) / sizeof(*(array)) )
24 #define STR(x) STR_INT(x)
26 /* NB not perfect because they evaluate arguments multiple times. */
28 #define max(x,y) ( (x)>(y) ? (x) : (y) )
31 #define min(x,y) ( (x)<(y) ? (x) : (y) )
50 /* UI_* are special keystrokes generated by front ends in response
51 * to menu actions, never passed to back ends */
60 /* made smaller because of 'limited range of datatype' errors. */
63 MOD_NUM_KEYPAD = 0x4000,
64 MOD_MASK = 0x7000 /* mask for all modifiers */
67 #define IS_MOUSE_DOWN(m) ( (unsigned)((m) - LEFT_BUTTON) <= \
68 (unsigned)(RIGHT_BUTTON - LEFT_BUTTON))
69 #define IS_MOUSE_DRAG(m) ( (unsigned)((m) - LEFT_DRAG) <= \
70 (unsigned)(RIGHT_DRAG - LEFT_DRAG))
71 #define IS_MOUSE_RELEASE(m) ( (unsigned)((m) - LEFT_RELEASE) <= \
72 (unsigned)(RIGHT_RELEASE - LEFT_RELEASE))
73 #define IS_CURSOR_MOVE(m) ( (m) == CURSOR_UP || (m) == CURSOR_DOWN || \
74 (m) == CURSOR_RIGHT || (m) == CURSOR_LEFT )
75 #define IS_CURSOR_SELECT(m) ( (m) == CURSOR_SELECT || (m) == CURSOR_SELECT2)
76 #define IS_UI_FAKE_KEY(m) ( (m) > UI_LOWER_BOUND && (m) < UI_UPPER_BOUND )
79 * Flags in the back end's `flags' word.
81 /* Bit flags indicating mouse button priorities */
82 #define BUTTON_BEATS(x,y) ( 1 << (((x)-LEFT_BUTTON)*3+(y)-LEFT_BUTTON) )
83 /* Flag indicating that Solve operations should be animated */
84 #define SOLVE_ANIMATES ( 1 << 9 )
85 /* Pocket PC: Game requires right mouse button emulation */
86 #define REQUIRE_RBUTTON ( 1 << 10 )
87 /* Pocket PC: Game requires numeric input */
88 #define REQUIRE_NUMPAD ( 1 << 11 )
89 /* end of `flags' word definitions */
92 /* Pocket PC devices have small, portrait screen that requires more vivid colours */
94 #define PORTRAIT_SCREEN
99 #define IGNOREARG(x) ( (x) = (x) )
101 typedef struct frontend frontend;
102 typedef struct config_item config_item;
103 typedef struct midend midend;
104 typedef struct random_state random_state;
105 typedef struct game_params game_params;
106 typedef struct game_state game_state;
107 typedef struct game_ui game_ui;
108 typedef struct game_drawstate game_drawstate;
109 typedef struct game game;
110 typedef struct blitter blitter;
111 typedef struct document document;
112 typedef struct drawing_api drawing_api;
113 typedef struct drawing drawing;
114 typedef struct psdata psdata;
116 #define ALIGN_VNORMAL 0x000
117 #define ALIGN_VCENTRE 0x100
119 #define ALIGN_HLEFT 0x000
120 #define ALIGN_HCENTRE 0x001
121 #define ALIGN_HRIGHT 0x002
124 #define FONT_VARIABLE 1
126 /* For printing colours */
127 #define HATCH_SLASH 1
128 #define HATCH_BACKSLASH 2
129 #define HATCH_HORIZ 3
135 * Structure used to pass configuration data between frontend and
138 enum { C_STRING, C_CHOICES, C_BOOLEAN, C_END };
140 /* Not dynamically allocated */
142 /* Value from the above C_* enum */
145 struct { /* if type == C_STRING */
146 /* Always dynamically allocated and non-NULL */
149 struct { /* if type == C_CHOICES */
151 * choicenames is non-NULL, not dynamically allocated, and
152 * contains a set of option strings separated by a
153 * delimiter. The delimiter is also the first character in
154 * the string, so for example ":Foo:Bar:Baz" gives three
155 * options `Foo', `Bar' and `Baz'.
157 const char *choicenames;
159 * Indicates the chosen index from the options in
160 * choicenames. In the above example, 0==Foo, 1==Bar and
166 /* just TRUE or FALSE */
173 * Structure used to communicate the presets menu from midend to
174 * frontend. In principle, it's also used to pass the same information
175 * from game to midend, though games that don't specify a menu
176 * hierarchy (i.e. most of them) will use the simpler fetch_preset()
177 * function to return an unstructured list.
179 * A tree of these structures always belongs to the midend, and only
180 * the midend should ever need to free it. The front end should treat
183 struct preset_menu_entry {
185 /* Exactly one of the next two fields is NULL, depending on
186 * whether this entry is a submenu title or an actual preset */
188 struct preset_menu *submenu;
189 /* Every preset menu entry has a number allocated by the mid-end,
190 * so that midend_which_preset() can return a value that
191 * identifies an entry anywhere in the menu hierarchy. The values
192 * will be allocated reasonably densely from 1 upwards (so it's
193 * reasonable for the front end to use them as array indices if it
194 * needs to store GUI state per menu entry), but no other
195 * guarantee is given about their ordering.
197 * Entries containing submenus have ids too - not only the actual
198 * presets are numbered. */
202 int n_entries; /* number of entries actually in use */
203 int entries_size; /* space currently allocated in this array */
204 struct preset_menu_entry *entries;
206 /* For games which do want to directly return a tree of these, here
207 * are convenience routines (in midend.c) for constructing one. These
208 * assume that 'title' and 'encoded_params' are already dynamically
209 * allocated by the caller; the resulting preset_menu tree takes
210 * ownership of them. */
211 struct preset_menu *preset_menu_new(void);
212 struct preset_menu *preset_menu_add_submenu(struct preset_menu *parent,
214 void preset_menu_add_preset(struct preset_menu *menu,
215 char *title, game_params *params);
216 /* Helper routine front ends can use for one of the ways they might
217 * want to organise their preset menu usage */
218 game_params *preset_menu_lookup_by_id(struct preset_menu *menu, int id);
224 /* We can't use #ifdef DEBUG, because Cygwin defines it by default. */
226 #define debug(x) (debug_printf x)
227 void debug_printf(char *fmt, ...);
232 void fatal(char *fmt, ...);
233 void frontend_default_colour(frontend *fe, float *output);
234 void deactivate_timer(frontend *fe);
235 void activate_timer(frontend *fe);
236 void get_random_seed(void **randseed, int *randseedsize);
241 drawing *drawing_new(const drawing_api *api, midend *me, void *handle);
242 void drawing_free(drawing *dr);
243 void draw_text(drawing *dr, int x, int y, int fonttype, int fontsize,
244 int align, int colour, char *text);
245 void draw_rect(drawing *dr, int x, int y, int w, int h, int colour);
246 void draw_line(drawing *dr, int x1, int y1, int x2, int y2, int colour);
247 void draw_polygon(drawing *dr, int *coords, int npoints,
248 int fillcolour, int outlinecolour);
249 void draw_circle(drawing *dr, int cx, int cy, int radius,
250 int fillcolour, int outlinecolour);
251 void draw_thick_line(drawing *dr, float thickness,
252 float x1, float y1, float x2, float y2, int colour);
253 void clip(drawing *dr, int x, int y, int w, int h);
254 void unclip(drawing *dr);
255 void start_draw(drawing *dr);
256 void draw_update(drawing *dr, int x, int y, int w, int h);
257 void end_draw(drawing *dr);
258 char *text_fallback(drawing *dr, const char *const *strings, int nstrings);
259 void status_bar(drawing *dr, char *text);
260 blitter *blitter_new(drawing *dr, int w, int h);
261 void blitter_free(drawing *dr, blitter *bl);
262 /* save puts the portion of the current display with top-left corner
263 * (x,y) to the blitter. load puts it back again to the specified
264 * coords, or else wherever it was saved from
265 * (if x = y = BLITTER_FROMSAVED). */
266 void blitter_save(drawing *dr, blitter *bl, int x, int y);
267 #define BLITTER_FROMSAVED (-1)
268 void blitter_load(drawing *dr, blitter *bl, int x, int y);
269 void print_begin_doc(drawing *dr, int pages);
270 void print_begin_page(drawing *dr, int number);
271 void print_begin_puzzle(drawing *dr, float xm, float xc,
272 float ym, float yc, int pw, int ph, float wmm,
274 void print_end_puzzle(drawing *dr);
275 void print_end_page(drawing *dr, int number);
276 void print_end_doc(drawing *dr);
277 void print_get_colour(drawing *dr, int colour, int printing_in_colour,
278 int *hatch, float *r, float *g, float *b);
279 int print_mono_colour(drawing *dr, int grey); /* 0==black, 1==white */
280 int print_grey_colour(drawing *dr, float grey);
281 int print_hatched_colour(drawing *dr, int hatch);
282 int print_rgb_mono_colour(drawing *dr, float r, float g, float b, int mono);
283 int print_rgb_grey_colour(drawing *dr, float r, float g, float b, float grey);
284 int print_rgb_hatched_colour(drawing *dr, float r, float g, float b,
286 void print_line_width(drawing *dr, int width);
287 void print_line_dotted(drawing *dr, int dotted);
292 midend *midend_new(frontend *fe, const game *ourgame,
293 const drawing_api *drapi, void *drhandle);
294 void midend_free(midend *me);
295 const game *midend_which_game(midend *me);
296 void midend_set_params(midend *me, game_params *params);
297 game_params *midend_get_params(midend *me);
298 void midend_size(midend *me, int *x, int *y, int user_size);
299 void midend_reset_tilesize(midend *me);
300 void midend_new_game(midend *me);
301 void midend_restart_game(midend *me);
302 void midend_stop_anim(midend *me);
303 int midend_process_key(midend *me, int x, int y, int button);
304 void midend_force_redraw(midend *me);
305 void midend_redraw(midend *me);
306 float *midend_colours(midend *me, int *ncolours);
307 void midend_freeze_timer(midend *me, float tprop);
308 void midend_timer(midend *me, float tplus);
309 struct preset_menu *midend_get_presets(midend *me, int *id_limit);
310 int midend_which_preset(midend *me);
311 int midend_wants_statusbar(midend *me);
312 enum { CFG_SETTINGS, CFG_SEED, CFG_DESC, CFG_FRONTEND_SPECIFIC };
313 config_item *midend_get_config(midend *me, int which, char **wintitle);
314 char *midend_set_config(midend *me, int which, config_item *cfg);
315 char *midend_game_id(midend *me, char *id);
316 char *midend_get_game_id(midend *me);
317 char *midend_get_random_seed(midend *me);
318 int midend_can_format_as_text_now(midend *me);
319 char *midend_text_format(midend *me);
320 char *midend_solve(midend *me);
321 int midend_status(midend *me);
322 int midend_can_undo(midend *me);
323 int midend_can_redo(midend *me);
324 void midend_supersede_game_desc(midend *me, char *desc, char *privdesc);
325 char *midend_rewrite_statusbar(midend *me, char *text);
326 void midend_serialise(midend *me,
327 void (*write)(void *ctx, void *buf, int len),
329 char *midend_deserialise(midend *me,
330 int (*read)(void *ctx, void *buf, int len),
332 char *identify_game(char **name, int (*read)(void *ctx, void *buf, int len),
334 void midend_request_id_changes(midend *me, void (*notify)(void *), void *ctx);
335 /* Printing functions supplied by the mid-end */
336 char *midend_print_puzzle(midend *me, document *doc, int with_soln);
337 int midend_tilesize(midend *me);
342 void *smalloc(size_t size);
343 void *srealloc(void *p, size_t size);
345 char *dupstr(const char *s);
347 ( (type *) smalloc (sizeof (type)) )
348 #define snewn(number, type) \
349 ( (type *) smalloc ((number) * sizeof (type)) )
350 #define sresize(array, number, type) \
351 ( (type *) srealloc ((array), (number) * sizeof (type)) )
356 void free_cfg(config_item *cfg);
357 void obfuscate_bitmap(unsigned char *bmp, int bits, int decode);
359 /* allocates output each time. len is always in bytes of binary data.
360 * May assert (or just go wrong) if lengths are unchecked. */
361 char *bin2hex(const unsigned char *in, int inlen);
362 unsigned char *hex2bin(const char *in, int outlen);
364 /* Sets (and possibly dims) background from frontend default colour,
365 * and auto-generates highlight and lowlight colours too. */
366 void game_mkhighlight(frontend *fe, float *ret,
367 int background, int highlight, int lowlight);
368 /* As above, but starts from a provided background colour rather
369 * than the frontend default. */
370 void game_mkhighlight_specific(frontend *fe, float *ret,
371 int background, int highlight, int lowlight);
373 /* Randomly shuffles an array of items. */
374 void shuffle(void *array, int nelts, int eltsize, random_state *rs);
376 /* Draw a rectangle outline, using the drawing API's draw_line. */
377 void draw_rect_outline(drawing *dr, int x, int y, int w, int h,
380 /* Draw a set of rectangle corners (e.g. for a cursor display). */
381 void draw_rect_corners(drawing *dr, int cx, int cy, int r, int col);
383 void move_cursor(int button, int *x, int *y, int maxw, int maxh, int wrap);
385 /* Used in netslide.c and sixteen.c for cursor movement around edge. */
386 int c2pos(int w, int h, int cx, int cy);
387 int c2diff(int w, int h, int cx, int cy, int button);
388 void pos2c(int w, int h, int pos, int *cx, int *cy);
390 /* Draws text with an 'outline' formed by offsetting the text
391 * by one pixel; useful for highlighting. Outline is omitted if -1. */
392 void draw_text_outline(drawing *dr, int x, int y, int fonttype,
393 int fontsize, int align,
394 int text_colour, int outline_colour, char *text);
396 /* Copies text left-justified with spaces. Length of string must be
397 * less than buffer size. */
398 void copy_left_justified(char *buf, size_t sz, const char *str);
403 int *snew_dsf(int size);
405 void print_dsf(int *dsf, int size);
407 /* Return the canonical element of the equivalence class containing element
408 * val. If 'inverse' is non-NULL, this function will put into it a flag
409 * indicating whether the canonical element is inverse to val. */
410 int edsf_canonify(int *dsf, int val, int *inverse);
411 int dsf_canonify(int *dsf, int val);
412 int dsf_size(int *dsf, int val);
414 /* Allow the caller to specify that two elements should be in the same
415 * equivalence class. If 'inverse' is TRUE, the elements are actually opposite
416 * to one another in some sense. This function will fail an assertion if the
417 * caller gives it self-contradictory data, ie if two elements are claimed to
418 * be both opposite and non-opposite. */
419 void edsf_merge(int *dsf, int v1, int v2, int inverse);
420 void dsf_merge(int *dsf, int v1, int v2);
421 void dsf_init(int *dsf, int len);
428 * Data structure implementing a 'to-do queue', a simple
429 * de-duplicating to-do list mechanism.
431 * Specification: a tdq is a queue which can hold integers from 0 to
432 * n-1, where n was some constant specified at tdq creation time. No
433 * integer may appear in the queue's current contents more than once;
434 * an attempt to add an already-present integer again will do nothing,
435 * so that that integer is removed from the queue at the position
436 * where it was _first_ inserted. The add and remove operations take
439 * The idea is that you might use this in applications like solvers:
440 * keep a tdq listing the indices of grid squares that you currently
441 * need to process in some way. Whenever you modify a square in a way
442 * that will require you to re-scan its neighbours, add them to the
443 * list with tdq_add; meanwhile you're constantly taking elements off
444 * the list when you need another square to process. In solvers where
445 * deductions are mostly localised, this should prevent repeated
446 * O(N^2) loops over the whole grid looking for something to do. (But
447 * if only _most_ of the deductions are localised, then you should
448 * respond to an empty to-do list by re-adding everything using
449 * tdq_fill, so _then_ you rescan the whole grid looking for newly
450 * enabled non-local deductions. Only if you've done that and emptied
451 * the list again finding nothing new to do are you actually done.)
453 typedef struct tdq tdq;
455 void tdq_free(tdq *tdq);
456 void tdq_add(tdq *tdq, int k);
457 int tdq_remove(tdq *tdq); /* returns -1 if nothing available */
458 void tdq_fill(tdq *tdq); /* add everything to the tdq at once */
463 int *domino_layout(int w, int h, random_state *rs);
464 void domino_layout_prealloc(int w, int h, random_state *rs,
465 int *grid, int *grid2, int *list);
474 random_state *random_new(const char *seed, int len);
475 random_state *random_copy(random_state *tocopy);
476 unsigned long random_bits(random_state *state, int bits);
477 unsigned long random_upto(random_state *state, unsigned long limit);
478 void random_free(random_state *state);
479 char *random_state_encode(random_state *state);
480 random_state *random_state_decode(const char *input);
481 /* random.c also exports SHA, which occasionally comes in useful. */
482 #if __STDC_VERSION__ >= 199901L
484 typedef uint32_t uint32;
485 #elif UINT_MAX >= 4294967295L
486 typedef unsigned int uint32;
488 typedef unsigned long uint32;
492 unsigned char block[64];
496 void SHA_Init(SHA_State *s);
497 void SHA_Bytes(SHA_State *s, const void *p, int len);
498 void SHA_Final(SHA_State *s, unsigned char *output);
499 void SHA_Simple(const void *p, int len, unsigned char *output);
504 document *document_new(int pw, int ph, float userscale);
505 void document_free(document *doc);
506 void document_add_puzzle(document *doc, const game *game, game_params *par,
507 game_state *st, game_state *st2);
508 void document_print(document *doc, drawing *dr);
513 psdata *ps_init(FILE *outfile, int colour);
514 void ps_free(psdata *ps);
515 drawing *ps_drawing_api(psdata *ps);
518 * combi.c: provides a structure and functions for iterating over
519 * combinations (i.e. choosing r things out of n).
521 typedef struct _combi_ctx {
522 int r, n, nleft, total;
526 combi_ctx *new_combi(int r, int n);
527 void reset_combi(combi_ctx *combi);
528 combi_ctx *next_combi(combi_ctx *combi); /* returns NULL for end */
529 void free_combi(combi_ctx *combi);
534 /* divides w*h rectangle into pieces of size k. Returns w*h dsf. */
535 int *divvy_rectangle(int w, int h, int k, random_state *rs);
540 struct findloopstate;
541 struct findloopstate *findloop_new_state(int nvertices);
542 void findloop_free_state(struct findloopstate *);
544 * Callback provided by the client code to enumerate the graph
545 * vertices joined directly to a given vertex.
547 * Semantics: if vertex >= 0, return one of its neighbours; if vertex
548 * < 0, return a previously unmentioned neighbour of whatever vertex
549 * was last passed as input. Write to 'ctx' as necessary to store
550 * state. In either case, return < 0 if no such vertex can be found.
552 typedef int (*neighbour_fn_t)(int vertex, void *ctx);
554 * Actual function to find loops. 'ctx' will be passed unchanged to
555 * the 'neighbour' function to query graph edges. Returns FALSE if no
556 * loop was found, or TRUE if one was.
558 int findloop_run(struct findloopstate *state, int nvertices,
559 neighbour_fn_t neighbour, void *ctx);
561 * Query whether an edge is part of a loop, in the output of
564 * Due to the internal storage format, if you pass u,v which are not
565 * connected at all, the output will be TRUE. (The algorithm actually
566 * stores an exhaustive list of *non*-loop edges, because there are
567 * fewer of those, so really it's querying whether the edge is on that
570 int findloop_is_loop_edge(struct findloopstate *state, int u, int v);
573 * Data structure containing the function calls and data specific
574 * to a particular game. This is enclosed in a data structure so
575 * that a particular platform can choose, if it wishes, to compile
576 * all the games into a single combined executable rather than
577 * having lots of little ones.
581 const char *winhelp_topic, *htmlhelp_topic;
582 game_params *(*default_params)(void);
583 int (*fetch_preset)(int i, char **name, game_params **params);
584 struct preset_menu *(*preset_menu)(void);
585 void (*decode_params)(game_params *, char const *string);
586 char *(*encode_params)(const game_params *, int full);
587 void (*free_params)(game_params *params);
588 game_params *(*dup_params)(const game_params *params);
590 config_item *(*configure)(const game_params *params);
591 game_params *(*custom_params)(const config_item *cfg);
592 char *(*validate_params)(const game_params *params, int full);
593 char *(*new_desc)(const game_params *params, random_state *rs,
594 char **aux, int interactive);
595 char *(*validate_desc)(const game_params *params, const char *desc);
596 game_state *(*new_game)(midend *me, const game_params *params,
598 game_state *(*dup_game)(const game_state *state);
599 void (*free_game)(game_state *state);
601 char *(*solve)(const game_state *orig, const game_state *curr,
602 const char *aux, char **error);
603 int can_format_as_text_ever;
604 int (*can_format_as_text_now)(const game_params *params);
605 char *(*text_format)(const game_state *state);
606 game_ui *(*new_ui)(const game_state *state);
607 void (*free_ui)(game_ui *ui);
608 char *(*encode_ui)(const game_ui *ui);
609 void (*decode_ui)(game_ui *ui, const char *encoding);
610 void (*changed_state)(game_ui *ui, const game_state *oldstate,
611 const game_state *newstate);
612 char *(*interpret_move)(const game_state *state, game_ui *ui,
613 const game_drawstate *ds, int x, int y, int button);
614 game_state *(*execute_move)(const game_state *state, const char *move);
615 int preferred_tilesize;
616 void (*compute_size)(const game_params *params, int tilesize,
618 void (*set_size)(drawing *dr, game_drawstate *ds,
619 const game_params *params, int tilesize);
620 float *(*colours)(frontend *fe, int *ncolours);
621 game_drawstate *(*new_drawstate)(drawing *dr, const game_state *state);
622 void (*free_drawstate)(drawing *dr, game_drawstate *ds);
623 void (*redraw)(drawing *dr, game_drawstate *ds, const game_state *oldstate,
624 const game_state *newstate, int dir, const game_ui *ui,
625 float anim_time, float flash_time);
626 float (*anim_length)(const game_state *oldstate,
627 const game_state *newstate, int dir, game_ui *ui);
628 float (*flash_length)(const game_state *oldstate,
629 const game_state *newstate, int dir, game_ui *ui);
630 int (*status)(const game_state *state);
631 int can_print, can_print_in_colour;
632 void (*print_size)(const game_params *params, float *x, float *y);
633 void (*print)(drawing *dr, const game_state *state, int tilesize);
636 int (*timing_state)(const game_state *state, game_ui *ui);
641 * Data structure containing the drawing API implemented by the
642 * front end and also by cross-platform printing modules such as
646 void (*draw_text)(void *handle, int x, int y, int fonttype, int fontsize,
647 int align, int colour, char *text);
648 void (*draw_rect)(void *handle, int x, int y, int w, int h, int colour);
649 void (*draw_line)(void *handle, int x1, int y1, int x2, int y2,
651 void (*draw_polygon)(void *handle, int *coords, int npoints,
652 int fillcolour, int outlinecolour);
653 void (*draw_circle)(void *handle, int cx, int cy, int radius,
654 int fillcolour, int outlinecolour);
655 void (*draw_update)(void *handle, int x, int y, int w, int h);
656 void (*clip)(void *handle, int x, int y, int w, int h);
657 void (*unclip)(void *handle);
658 void (*start_draw)(void *handle);
659 void (*end_draw)(void *handle);
660 void (*status_bar)(void *handle, char *text);
661 blitter *(*blitter_new)(void *handle, int w, int h);
662 void (*blitter_free)(void *handle, blitter *bl);
663 void (*blitter_save)(void *handle, blitter *bl, int x, int y);
664 void (*blitter_load)(void *handle, blitter *bl, int x, int y);
665 void (*begin_doc)(void *handle, int pages);
666 void (*begin_page)(void *handle, int number);
667 void (*begin_puzzle)(void *handle, float xm, float xc,
668 float ym, float yc, int pw, int ph, float wmm);
669 void (*end_puzzle)(void *handle);
670 void (*end_page)(void *handle, int number);
671 void (*end_doc)(void *handle);
672 void (*line_width)(void *handle, float width);
673 void (*line_dotted)(void *handle, int dotted);
674 char *(*text_fallback)(void *handle, const char *const *strings,
676 void (*draw_thick_line)(void *handle, float thickness,
677 float x1, float y1, float x2, float y2,
682 * For one-game-at-a-time platforms, there's a single structure
683 * like the above, under a fixed name. For all-at-once platforms,
684 * there's a list of all available puzzles in array form.
687 extern const game *gamelist[];
688 extern const int gamecount;
690 extern const game thegame;
694 * Special string value to return from interpret_move in the case
695 * where the game UI has been updated but no actual move is being
696 * appended to the undo chain. Must be declared as a non-const char,
697 * but should never actually be modified by anyone.
699 extern char UI_UPDATE[];
701 /* A little bit of help to lazy developers */
702 #define DEFAULT_STATUSBAR_TEXT "Use status_bar() to fill this in."
704 #endif /* PUZZLES_PUZZLES_H */