Move definition of PI into puzzles.h. If nothing else, the definition in cube.c
[sgt/puzzles] / list.c
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
13 perl -ne '/^#define thegame (\S+)/ and $1 ne "nullgame" and print "extern const game $1;\n"' *.c
14 echo -e '\nconst game *gamelist[] = {'
15 perl -ne '/^#define thegame (\S+)/ and $1 ne "nullgame" and print " &$1,\n"' *.c
16 echo -e '};\n\nconst int gamecount = lenof(gamelist);'
17
18 */
19
20 extern const game cube;
21 extern const game fifteen;
22 extern const game mines;
23 extern const game net;
24 extern const game netslide;
25 extern const game pattern;
26 extern const game rect;
27 extern const game sixteen;
28 extern const game solo;
29 extern const game twiddle;
30
31 const game *gamelist[] = {
32 &cube,
33 &fifteen,
34 &mines,
35 &net,
36 &netslide,
37 &pattern,
38 &rect,
39 &sixteen,
40 &solo,
41 &twiddle,
42 };
43
44 const int gamecount = lenof(gamelist);