chiark
/
gitweb
/
~ian
/
sgt-puzzles.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2b392a9
)
Remove extraneous underscores at start and end of Rectangles seeds.
author
Simon Tatham
<anakin@pobox.com>
Tue, 17 Aug 2004 11:51:20 +0000
(11:51 +0000)
committer
Simon Tatham
<anakin@pobox.com>
Tue, 17 Aug 2004 11:51:20 +0000
(11:51 +0000)
[originally from svn r4473]
rect.c
patch
|
blob
|
history
diff --git
a/rect.c
b/rect.c
index b9d7cda1fbe336c45f124464b79850b70ca7b6c4..06ccff6d2ffc90c58ea590e24b26301b6e3325a9 100644
(file)
--- 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);