shithub: puzzles

Download patch

ref: cbf2ede64ad91346e6399603ff7b8df432be5a06
parent: a46bbae7c16595e6f5eb02add637da337a1f075a
author: Chris Boyle <chris@boyle.name>
date: Tue Dec 20 18:48:01 EST 2016

lightup: Ban 2x2 with either 4-way type

(2x2 with four-way symmetry must be either all-black (trivial) or
all-white (ambiguous). --bjh21)

(cherry picked from Android port, commit
27ae898e118b0a31a98d393bf56aa138845123e6)

--- a/lightup.c
+++ b/lightup.c
@@ -353,6 +353,8 @@
             if (params->symm == SYMM_ROT4)
                 return "4-fold symmetry is only available with square grids";
         }
+        if ((params->symm == SYMM_ROT4 || params->symm == SYMM_REF4) && params->w < 3 && params->h < 3)
+            return _("Width or height must be at least 3 for 4-way symmetry");
         if (params->symm < 0 || params->symm >= SYMM_MAX)
             return "Unknown symmetry type";
         if (params->difficulty < 0 || params->difficulty > DIFFCOUNT)