Use srandomdev
This commit is contained in:
parent
a6a138361d
commit
8e3c5b0ce7
@ -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();
|
||||
|
@ -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 *
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user