diff --git a/games/hack/hack.mklev.c b/games/hack/hack.mklev.c index 236f83268e2..3217923d274 100644 --- a/games/hack/hack.mklev.c +++ b/games/hack/hack.mklev.c @@ -1,9 +1,11 @@ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* hack.mklev.c - version 1.0.3 */ +#include +#include + #include "hack.h" -extern char *getlogin(), *getenv(); extern struct monst *makemon(); extern struct obj *mkobj_at(); extern struct trap *maketrap(); diff --git a/games/hack/hack.unix.c b/games/hack/hack.unix.c index 88e743f9551..88ebdd606b0 100644 --- a/games/hack/hack.unix.c +++ b/games/hack/hack.unix.c @@ -14,22 +14,16 @@ #include #include +#include #include "hack.h" /* mainly for index() which depends on BSD */ #include /* for time_t and stat */ #include -#ifdef BSD -#include -#else #include -#endif BSD - -extern char *getenv(); -extern time_t time(); setrandom() { - (void) srandom((int) time ((time_t *) 0)); + (void) srandomdev(); } struct tm * diff --git a/games/hack/rnd.c b/games/hack/rnd.c index 8547cef210a..022cf691014 100644 --- a/games/hack/rnd.c +++ b/games/hack/rnd.c @@ -1,6 +1,8 @@ /* rnd.c - version 1.0.2 */ -#define RND(x) ((random()>>3) % x) +#include + +#define RND(x) (random() % x) rn1(x,y) register x,y;