3 ms·
That collection is technically kind of interesting too. The puzzle code itself is written in portable C, using a custom-built common framework and UI abstractio
by teraflop 12y ago
That collection is technically kind of interesting too. The puzzle code itself is written in portable C, using a custom-built common framework and UI abstraction layer that allows it to run on pretty much any platform.
http://www.chiark.greenend.org.uk/~sgtatham/puzzles/devel/ http://www.chiark.greenend.org.uk/~sgtatham/puzzles/devel/
- jcl 12y agoAlso, each puzzle has its own custom constraint solver to generate fresh puzzles with desirable characteristics. For example, the version of minesweeper in the collection generates puzzles such that the first click never reveals a mine and that there is always a logical path to the solution -- no guessing needed.
- Zeebrommer 12y agoI always wonder with these kinds of puzzles how one can come up with an initial settings that (a) yields a unique correct solution and (b) has a logical next step at every step (so doesn't require thinking ahead x steps to arrive at a conflict)
- thisjepisje 12y agoOne possibility is to generate or change small parts of the puzzle each turn. For minesweeper for example you start out with an empty field, and after the first click you generate the mines.
- teraflop 12y agoConveniently enough, there's a long section of the developer docs that covers exactly that topic: http://www.chiark.greenend.org.uk/~sgtatham/puzzles/devel/writing.html#writing-generation http://www.chiark.greenend.org.uk/~sgtatham/puzzles/devel/wr...
- mythmon_ 12y agoFor at least Loopy, the generator works by generating a full puzzle with all hints, and then removing hints one at a time until the solver can't solve the puzzle. So the complexity of the puzzles that can be generated are dependent on the cleverness of the solver.
- Zeebrommer 12y agoThat's less elegant than I hoped for. Still works though!
- brianpgordon 12y agoThis almost seems like something you'd see in a thedailywtf article. Want to write an application that does X? Design, build, test, and document a flexible cross-platform framework that can safely and portably run any application in the domain, and then specialize it to do X! I have to say, though, that it seems to have actually worked out for the best in this case. He added a ton of puzzles at a rapid pace and they've spread to a surprising number of platforms.
- teraflop 12y agoAnd now maybe you understand why "flexible cross-platform frameworks" are not automatically a WTF ;)