Hacker News new | past | comments | ask | show | jobs | submit login

I've done this for Sudoku, cross sums and similar. Generally, I used a backtracking algorithm to fill an empty grid until a valid grid was found.

Assuming you want to control the level of difficulty of the puzzle generated, you want to incorporate the difficulty heuristics into the step-by-step filling-in algorithm (rather than just use them to score the puzzle after the fact).

Also, this probably should have been obvious, but at first I didn't do this: you get better control of the difficulty by basing your heuristics directly on the actual solving methods that people use. (If you don't somehow know already, you can, e.g., get a good book on solving sudoku which will enumerate the techniques and classify the difficulty as well. Once you understand the specific solving strategies for sudoku, you can probably generalize them to other logic puzzles.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: