aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2004-08-17 11:51:20 +0000
committerSimon Tatham <anakin@pobox.com>2004-08-17 11:51:20 +0000
commitae63b8010b2fbac2eb591da888eefa9566da2b5f (patch)
tree9f4361de5b6132e47b5bcbcc78b92b6b2c61a1bd
parent2b392a9d5a0e269e1a8ef2281882f55facdee60f (diff)
downloadpuzzles-ae63b8010b2fbac2eb591da888eefa9566da2b5f.zip
puzzles-ae63b8010b2fbac2eb591da888eefa9566da2b5f.tar.gz
puzzles-ae63b8010b2fbac2eb591da888eefa9566da2b5f.tar.bz2
puzzles-ae63b8010b2fbac2eb591da888eefa9566da2b5f.tar.xz
Remove extraneous underscores at start and end of Rectangles seeds.
[originally from svn r4473]
-rw-r--r--rect.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/rect.c b/rect.c
index b9d7cda..06ccff6 100644
--- a/rect.c
+++ b/rect.c
@@ -881,7 +881,13 @@ char *new_game_seed(game_params *params, random_state *rs)
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);