Don't try to run solver_killer_sums on a Killer cage with only one
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 2 Feb 2012 23:04:43 +0000 (23:04 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 2 Feb 2012 23:04:43 +0000 (23:04 +0000)
square. It isn't equipped for it, and will try to handle it with the
4-square case and get confused. This can come up if the
DIFF_KINTERSECT pass before that split a cage, and will cause the
solver to miss valid solutions; e.g. 3x3kadu#802065940985372 would
generate an ambiguous puzzle before this change.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@9402 cda61777-01e9-0310-a592-d414129be87e

solo.c

diff --git a/solo.c b/solo.c
index 766adde..6987872 100644 (file)
--- a/solo.c
+++ b/solo.c
@@ -1473,7 +1473,7 @@ static int solver_killer_sums(struct solver_usage *usage, int b,
     }
     assert(nsquares > 0);
 
-    if (nsquares > 4)
+    if (nsquares < 2 || nsquares > 4)
        return 0;
 
     if (!cage_is_region) {