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