Add Windows help topic
[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 cube;
21extern const game fifteen;
22extern const game mines;
23extern const game net;
24extern const game netslide;
25extern const game pattern;
26extern const game rect;
27extern const game samegame;
28extern const game sixteen;
29extern const game solo;
30extern const game twiddle;
31
32const game *gamelist[] = {
33 &cube,
34 &fifteen,
35 &mines,
36 &net,
37 &netslide,
38 &pattern,
39 &rect,
40 &samegame,
41 &sixteen,
42 &solo,
43 &twiddle,
44};
45
46const int gamecount = lenof(gamelist);