X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/blobdiff_plain/102d0d14faf12415db0b1cd4bf3a2d510aa798c8..97c44af328d9279dddd513001ff7c7d22c001c3c:/midend.c diff --git a/midend.c b/midend.c index 1d7087a..070f4f3 100644 --- a/midend.c +++ b/midend.c @@ -135,11 +135,16 @@ void midend_new_game(midend_data *me) /* * Generate a new random seed. 15 digits comes to about * 48 bits, which should be more than enough. + * + * I'll avoid putting a leading zero on the number, + * just in case it confuses anybody who thinks it's + * processed as an integer rather than a string. */ char newseed[16]; int i; newseed[15] = '\0'; - for (i = 0; i < 15; i++) + newseed[0] = '1' + random_upto(me->random, 9); + for (i = 1; i < 15; i++) newseed[i] = '0' + random_upto(me->random, 10); sfree(me->seedstr); me->seedstr = dupstr(newseed);