Files
puzzles/list.c
Simon Tatham 347de40a2e Another new puzzle! This one isn't particularly deep or complex
(solving it only requires matrix inversion over GF(2), whereas
several of the other puzzles in this collection are NP-complete in
principle), but it's a fun enough thing to play with and is
non-trivial to do in your head - especially on the hardest preset.

[originally from svn r5967]
2005-06-17 17:16:49 +00:00

49 lines
1.1 KiB
C

/*
* list.c: List of puzzles.
*/
#include "puzzles.h"
/*
* The available games can be most easily enumerated by searching
* for the line in each game source file saying "#define thegame
* <gamename>". Hence, the following piece of shell/Perl should
* regenerate this list automatically:
perl -ne '/^#define thegame (\S+)/ and $1 ne "nullgame" and print "extern const game $1;\n"' *.c
echo -e '\nconst game *gamelist[] = {'
perl -ne '/^#define thegame (\S+)/ and $1 ne "nullgame" and print " &$1,\n"' *.c
echo -e '};\n\nconst int gamecount = lenof(gamelist);'
*/
extern const game cube;
extern const game fifteen;
extern const game flip;
extern const game mines;
extern const game net;
extern const game netslide;
extern const game pattern;
extern const game rect;
extern const game samegame;
extern const game sixteen;
extern const game solo;
extern const game twiddle;
const game *gamelist[] = {
&cube,
&fifteen,
&flip,
&mines,
&net,
&netslide,
&pattern,
&rect,
&samegame,
&sixteen,
&solo,
&twiddle,
};
const int gamecount = lenof(gamelist);