simon-svn: puzzles: simon
tartarus-commits at lists.tartarus.org
tartarus-commits at lists.tartarus.org
Thu May 19 17:17:04 BST 2005
SVN root: svn://ixion.tartarus.org/main
Changes by: simon
Revision: 5809
Date: 2005-05-19 17:17:03 +0100 (Thu, 19 May 2005)
Log message (13 lines):
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.
Modified files:
U puzzles/puzzles.but
U puzzles/rect.c
Links:
http://www.tartarus.org/~simon-anonsvn/viewcvs.cgi?rev=5809&view=rev
http://www.tartarus.org/~simon-anonsvn/viewcvs.cgi/puzzles/puzzles.but?rev=5809&r1=5808&r2=5809
http://www.tartarus.org/~simon-anonsvn/viewcvs.cgi/puzzles/rect.c?rev=5809&r1=5808&r2=5809
More information about the tartarus-commits
mailing list