Simon Tatham's remarks [1] on writing friendly (i.e. guaranteed solvable) puzzle games. Of note:
1) a variant of minesweeper that never requires you to guess
2) a pile of proofs in net.c [2], along with tactics to generate uniquely solvable boards for a game you might know as KNetWalk.
3) untangle.c [3], a reimplementation of Planarity [4] with a different graph generation method (see static char * new_game_desc).

[1] http://www.chiark.greenend.org.uk/~sgtatham/puzzles/devel/writing.html
[2] http://svn.tartarus.org/sgt/puzzles/net.c?view=markup
[3] http://svn.tartarus.org/sgt/puzzles/untangle.c?view=markup
[4] http://en.wikipedia.org/wiki/Planarity
Shared publicly