Cunning way to ensure unique solutions in generated Rectangles
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 19 May 2005 16:17:03 +0000 (16:17 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 19 May 2005 16:17:03 +0000 (16:17 +0000)
commit26801d29c8305a5cb9bd3709909b1eeb896aa3e4
tree45d3aca21b7b69f5227fdcb8f07cbeccd3916dbf
parentf60f7e7c3f3589b57214fd76c6919bb4dafd8d2c
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.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@5809 cda61777-01e9-0310-a592-d414129be87e
puzzles.but
rect.c