From d95f476d8b61dcbb9dc1c9bc9398cb295096cd2c Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 8 Apr 2018 17:55:59 +0100 Subject: [PATCH] Solo: add a missing params constraint for X puzzles. 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/solo.c b/solo.c index e72b14f..dae0998 100644 --- 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; }