Bah! There's _always_ one. Display glitch corrected.
[sgt/puzzles] / list.c
... / ...
CommitLineData
1/*
2 * list.c: List of puzzles.
3 */
4
5#include "puzzles.h"
6
7/*
8 * The available games can be most easily enumerated by searching
9 * for the line in each game source file saying "#define thegame
10 * <gamename>". Hence, the following piece of shell/Perl should
11 * regenerate this list automatically:
12
13perl -ne '/^#define thegame (\S+)/ and $1 ne "nullgame" and print "extern const game $1;\n"' *.c
14echo -e '\nconst game *gamelist[] = {'
15perl -ne '/^#define thegame (\S+)/ and $1 ne "nullgame" and print " &$1,\n"' *.c
16echo -e '};\n\nconst int gamecount = lenof(gamelist);'
17
18 */
19
20extern const game blackbox;
21extern const game cube;
22extern const game dominosa;
23extern const game fifteen;
24extern const game flip;
25extern const game guess;
26extern const game mines;
27extern const game net;
28extern const game netslide;
29extern const game pattern;
30extern const game pegs;
31extern const game rect;
32extern const game samegame;
33extern const game sixteen;
34extern const game slant;
35extern const game solo;
36extern const game twiddle;
37extern const game untangle;
38
39const game *gamelist[] = {
40 &blackbox,
41 &cube,
42 &dominosa,
43 &fifteen,
44 &flip,
45 &guess,
46 &mines,
47 &net,
48 &netslide,
49 &pattern,
50 &pegs,
51 &rect,
52 &samegame,
53 &sixteen,
54 &slant,
55 &solo,
56 &twiddle,
57 &untangle,
58};
59
60const int gamecount = lenof(gamelist);