It's a new year.
[sgt/puzzles] / list.c
CommitLineData
19ef4855 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
bf7ebf5a 20extern const game blackbox;
e7c63b02 21extern const game bridges;
19ef4855 22extern const game cube;
6c04c334 23extern const game dominosa;
19ef4855 24extern const game fifteen;
f4afe206 25extern const game flip;
74476385 26extern const game guess;
81eef9aa 27extern const game inertia;
e3478a4b 28extern const game lightup;
6193da8d 29extern const game loopy;
c51c7de6 30extern const game map;
7959b517 31extern const game mines;
19ef4855 32extern const game net;
33extern const game netslide;
34extern const game pattern;
32ee875d 35extern const game pegs;
19ef4855 36extern const game rect;
e839f206 37extern const game samegame;
19ef4855 38extern const game sixteen;
f1010613 39extern const game slant;
1d8e8ad8 40extern const game solo;
86e60e3d 41extern const game tents;
9038fd11 42extern const game twiddle;
9d6c3859 43extern const game untangle;
19ef4855 44
45const game *gamelist[] = {
bf7ebf5a 46 &blackbox,
e7c63b02 47 &bridges,
19ef4855 48 &cube,
6c04c334 49 &dominosa,
19ef4855 50 &fifteen,
f4afe206 51 &flip,
74476385 52 &guess,
81eef9aa 53 &inertia,
e3478a4b 54 &lightup,
6193da8d 55 &loopy,
c51c7de6 56 &map,
7959b517 57 &mines,
19ef4855 58 &net,
59 &netslide,
60 &pattern,
32ee875d 61 &pegs,
19ef4855 62 &rect,
e839f206 63 &samegame,
19ef4855 64 &sixteen,
f1010613 65 &slant,
1d8e8ad8 66 &solo,
86e60e3d 67 &tents,
9038fd11 68 &twiddle,
9d6c3859 69 &untangle,
19ef4855 70};
71
72const int gamecount = lenof(gamelist);