Ensure the ZZZZ magic word is reproducible.

This happens by making the SEED command also regenerate the magic word.
This commit is contained in:
Jason S. Ninneman 2017-05-26 16:34:16 -07:00
parent f2043034e5
commit f9eca41f3a
3 changed files with 5 additions and 3 deletions

2
main.c
View file

@ -160,6 +160,8 @@ static bool fallback_handler(signed char *buf)
if (sscanf(buf, "seed %ld", &sv) == 1) {
set_seed(sv);
printf("Seed set to %ld\n", sv);
// here we reconfigure any global game state that uses random numbers
ZZWORD=RNDVOC(3,0)+MESH*2;
return true;
}
return false;

View file

@ -7,8 +7,8 @@ You are standing at the end of a road before a small brick building.
Around you is a forest. A small stream flows out of the building and
down a gully.
> seed 1495752222
Seed set to 1495752222
> seed 1494912171
Seed set to 1494912171
You're in front of building.

View file

@ -1,6 +1,6 @@
## Death by dwarf.
n
seed 1495752222
seed 1494912171
in
take keys
take lamp