New puzzle: `Inertia', originally written for Windows by Ben
[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 inertia;
27extern const game lightup;
28extern const game loopy;
29extern const game map;
30extern const game mines;
31extern const game net;
32extern const game netslide;
33extern const game pattern;
34extern const game pegs;
35extern const game rect;
36extern const game samegame;
37extern const game sixteen;
38extern const game slant;
39extern const game solo;
40extern const game twiddle;
41extern const game untangle;
42
43const game *gamelist[] = {
44 &blackbox,
45 &cube,
46 &dominosa,
47 &fifteen,
48 &flip,
49 &guess,
50 &inertia,
51 &lightup,
52 &loopy,
53 &map,
54 &mines,
55 &net,
56 &netslide,
57 &pattern,
58 &pegs,
59 &rect,
60 &samegame,
61 &sixteen,
62 &slant,
63 &solo,
64 &twiddle,
65 &untangle,
66};
67
68const int gamecount = lenof(gamelist);