New puzzle: `Loopy', an implementation of Nikoli's `Slither Link' or
[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;
19ef4855 21extern const game cube;
6c04c334 22extern const game dominosa;
19ef4855 23extern const game fifteen;
f4afe206 24extern const game flip;
74476385 25extern const game guess;
e3478a4b 26extern const game lightup;
6193da8d 27extern const game loopy;
c51c7de6 28extern const game map;
7959b517 29extern const game mines;
19ef4855 30extern const game net;
31extern const game netslide;
32extern const game pattern;
32ee875d 33extern const game pegs;
19ef4855 34extern const game rect;
e839f206 35extern const game samegame;
19ef4855 36extern const game sixteen;
f1010613 37extern const game slant;
1d8e8ad8 38extern const game solo;
9038fd11 39extern const game twiddle;
9d6c3859 40extern const game untangle;
19ef4855 41
42const game *gamelist[] = {
bf7ebf5a 43 &blackbox,
19ef4855 44 &cube,
6c04c334 45 &dominosa,
19ef4855 46 &fifteen,
f4afe206 47 &flip,
74476385 48 &guess,
e3478a4b 49 &lightup,
6193da8d 50 &loopy,
c51c7de6 51 &map,
7959b517 52 &mines,
19ef4855 53 &net,
54 &netslide,
55 &pattern,
32ee875d 56 &pegs,
19ef4855 57 &rect,
e839f206 58 &samegame,
19ef4855 59 &sixteen,
f1010613 60 &slant,
1d8e8ad8 61 &solo,
9038fd11 62 &twiddle,
9d6c3859 63 &untangle,
19ef4855 64};
65
66const int gamecount = lenof(gamelist);