Add -d option

This commit is contained in:
Eric S. Raymond 2023-03-29 16:04:36 -04:00
parent c80162b467
commit ff46cf7fac
3 changed files with 11 additions and 4 deletions

5
misc.c
View file

@ -699,7 +699,7 @@ bool tstbit(int mask, int bit)
}
void set_seed(int32_t seedval)
/* Set the LCG seed */
/* Set the LCG1 seed */
{
game.lcg_x = seedval % LCG_M;
if (game.lcg_x < 0) {
@ -718,6 +718,9 @@ static int32_t get_next_lcg_value(void)
{
int32_t old_x = game.lcg_x;
game.lcg_x = (LCG_A * game.lcg_x + LCG_C) % LCG_M;
if (settings.debug) {
printf("# random %d\n", old_x);
}
return old_x;
}