projects
/
open-adventure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move PRNG initialization to simplify cheat.c
[open-adventure.git]
/
main.c
diff --git
a/main.c
b/main.c
index a6027f8136e06637db534a1a3df691a0e8384e3e..077e3a996d200dde709fda3215035b194f5c9c99 100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-19,7
+19,6
@@
#include <stdbool.h>
#include <getopt.h>
#include <signal.h>
#include <stdbool.h>
#include <getopt.h>
#include <signal.h>
-#include <time.h>
#include <string.h>
#include "advent.h"
#include "linenoise/linenoise.h"
#include <string.h>
#include "advent.h"
#include "linenoise/linenoise.h"
@@
-138,17
+137,8
@@
int main(int argc, char *argv[])
linenoiseHistorySetMaxLen(350);
linenoiseHistorySetMaxLen(350);
- /* Initialize our LCG PRNG with parameters tested against
- * Knuth vol. 2. by the original authors */
- game.lcg_a = 1093;
- game.lcg_c = 221587;
- game.lcg_m = 1048576;
- srand(time(NULL));
- long seedval = (long)rand();
- set_seed(seedval);
-
/* Initialize game variables */
/* Initialize game variables */
- initialise();
+
long seedval =
initialise();
/* Start-up, dwarf stuff */
make_zzword(game.zzword);
/* Start-up, dwarf stuff */
make_zzword(game.zzword);