aboutsummaryrefslogtreecommitdiff
path: root/pattern.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2005-05-19 16:17:03 +0000
committerSimon Tatham <anakin@pobox.com>2005-05-19 16:17:03 +0000
commit93b955d5ee3d2ba7f36b1b6f7c17d06f1d7497a4 (patch)
tree45d3aca21b7b69f5227fdcb8f07cbeccd3916dbf /pattern.c
parentb1c0d665bd0b3d62f060b8a7d0e27b92bd03d2c1 (diff)
downloadpuzzles-93b955d5ee3d2ba7f36b1b6f7c17d06f1d7497a4.zip
puzzles-93b955d5ee3d2ba7f36b1b6f7c17d06f1d7497a4.tar.gz
puzzles-93b955d5ee3d2ba7f36b1b6f7c17d06f1d7497a4.tar.bz2
puzzles-93b955d5ee3d2ba7f36b1b6f7c17d06f1d7497a4.tar.xz
Cunning way to ensure unique solutions in generated Rectangles
puzzles. I generate the grid of rectangles as normal, but before I place the numbers I run it through a non-deterministic solver algorithm which tries to do as much as it can with as little information about where the numbers are going to be. The solver itself narrows down the number placement when it runs out of steam, but does so as little as possible. Once it reaches a state where it has ensured solubility, and then the generation algorithm chooses random number placement from whatever's left. Occasionally it paints itself into a corner and can't ensure a unique solution no matter what happens; in that situation we just have to give up, generate a fresh grid, and try again. [originally from svn r5809]
Diffstat (limited to 'pattern.c')
0 files changed, 0 insertions, 0 deletions