From: Jason S. Ninneman Date: Fri, 26 May 2017 23:34:16 +0000 (-0700) Subject: Ensure the ZZZZ magic word is reproducible. X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=c41dd3526880155c3498b42cbd58eb8ad71ba6aa;p=open-adventure.git Ensure the ZZZZ magic word is reproducible. This happens by making the SEED command also regenerate the magic word. --- diff --git a/main.c b/main.c index 5a7c523..271e8a7 100644 --- a/main.c +++ b/main.c @@ -148,6 +148,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; diff --git a/tests/dwarf.chk b/tests/dwarf.chk index fcf3a1e..2f7f6d7 100644 --- a/tests/dwarf.chk +++ b/tests/dwarf.chk @@ -7,6 +7,7 @@ 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. +<<<<<<< HEAD > seed 1495763690 Seed set to 1495763690 @@ -14,6 +15,10 @@ You're in front of building. > seed 1495752222 Seed set to 1495752222 +======= +> seed 1494912171 +Seed set to 1494912171 +>>>>>>> f9eca41 (Ensure the ZZZZ magic word is reproducible.) You're in front of building. diff --git a/tests/dwarf.log b/tests/dwarf.log new file mode 100644 index 0000000..b50a35f --- /dev/null +++ b/tests/dwarf.log @@ -0,0 +1,59 @@ +## Death by dwarf. +n +seed 1494912171 +in +take keys +take lamp +out +down +s +s +open grate +down +west +take cage +west +light lamp +take rod +xyzzy +xyzzy +west +drop rod +west +take bird +east +take rod +west +west +down +south +take gold +n +n +drop bird +west +take coins +e +s +drop cage +take jewelry +take axe +n +n +n +plugh +inven +drop jewelry +drop gold +inven +drop keys +plugh +s +s +up +w +wave rod +w +take diamonds +e +n