shithub: puzzles

Download patch

ref: ae63b8010b2fbac2eb591da888eefa9566da2b5f
parent: 2b392a9d5a0e269e1a8ef2281882f55facdee60f
author: Simon Tatham <anakin@pobox.com>
date: Tue Aug 17 07:51:20 EDT 2004

Remove extraneous underscores at start and end of Rectangles seeds.

[originally from svn r4473]

--- a/rect.c
+++ b/rect.c
@@ -881,7 +881,13 @@
                     run -= c - ('a' - 1);
                 }
             } else {
-                *p++ = '_';
+                /*
+                 * If there's a number in the very top left or
+                 * bottom right, there's no point putting an
+                 * unnecessary _ before or after it.
+                 */
+                if (p > seed && n > 0)
+                    *p++ = '_';
             }
             if (n > 0)
                 p += sprintf(p, "%d", n);