Revert the code that assumed that incoming parameters used a random generation
[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 flip;
23extern const game guess;
24extern const game mines;
25extern const game net;
26extern const game netslide;
27extern const game pattern;
28extern const game pegs;
29extern const game rect;
30extern const game samegame;
31extern const game sixteen;
32extern const game solo;
33extern const game twiddle;
34
35const game *gamelist[] = {
36 &cube,
37 &fifteen,
38 &flip,
39 &guess,
40 &mines,
41 &net,
42 &netslide,
43 &pattern,
44 &pegs,
45 &rect,
46 &samegame,
47 &sixteen,
48 &solo,
49 &twiddle,
50};
51
52const int gamecount = lenof(gamelist);