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