Use srandomdev

This commit is contained in:
ache 1997-09-24 05:18:42 +00:00
parent a6a138361d
commit 8e3c5b0ce7
3 changed files with 8 additions and 10 deletions

View File

@ -1,9 +1,11 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* hack.mklev.c - version 1.0.3 */
#include <stdlib.h>
#include <unistd.h>
#include "hack.h"
extern char *getlogin(), *getenv();
extern struct monst *makemon();
extern struct obj *mkobj_at();
extern struct trap *maketrap();

View File

@ -14,22 +14,16 @@
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include "hack.h" /* mainly for index() which depends on BSD */
#include <sys/types.h> /* for time_t and stat */
#include <sys/stat.h>
#ifdef BSD
#include <sys/time.h>
#else
#include <time.h>
#endif BSD
extern char *getenv();
extern time_t time();
setrandom()
{
(void) srandom((int) time ((time_t *) 0));
(void) srandomdev();
}
struct tm *

View File

@ -1,6 +1,8 @@
/* rnd.c - version 1.0.2 */
#define RND(x) ((random()>>3) % x)
#include <stdlib.h>
#define RND(x) (random() % x)
rn1(x,y)
register x,y;