chiark / gitweb /
Solo: add a missing params constraint for X puzzles.
authorSimon Tatham <anakin@pobox.com>
Sun, 8 Apr 2018 16:55:59 +0000 (17:55 +0100)
committerSimon Tatham <anakin@pobox.com>
Sun, 8 Apr 2018 16:55:59 +0000 (17:55 +0100)
Michael Quevillon points out that neither 2x1 nor 3x1 Solo can be made
into an X Sudoku puzzle, on the grounds that whatever number goes in
one corner of the grid is ruled out from both ends (and the centre, if
any) of the opposing diagonal, and hence the X constraint can't be
satisfied.

(Also fixed a spurious full stop on a neighbouring line.)

solo.c

diff --git a/solo.c b/solo.c
index e72b14f48b46e85aeba288c3c573f83560cb63f0..dae099834fce1a8ca6b6f0ca1cd0ec31f0780f8e 100644 (file)
--- a/solo.c
+++ b/solo.c
@@ -510,7 +510,9 @@ static const char *validate_params(const game_params *params, int full)
     if ((params->c * params->r) > 31)
         return "Unable to support more than 31 distinct symbols in a puzzle";
     if (params->killer && params->c * params->r > 9)
-       return "Killer puzzle dimensions must be smaller than 10.";
+        return "Killer puzzle dimensions must be smaller than 10";
+    if (params->xtype && params->c * params->r < 4)
+        return "X-type puzzle dimensions must be larger than 3";
     return NULL;
 }