1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00
freebsd/games/hack/rnd.c
Andrey A. Chernov 3320fc4786 Use srandomdev
1997-09-24 05:18:42 +00:00

33 lines
299 B
C

/* rnd.c - version 1.0.2 */
#include <stdlib.h>
#define RND(x) (random() % x)
rn1(x,y)
register x,y;
{
return(RND(x)+y);
}
rn2(x)
register x;
{
return(RND(x));
}
rnd(x)
register x;
{
return(RND(x)+1);
}
d(n,x)
register n,x;
{
register tmp = n;
while(n--) tmp += RND(x);
return(tmp);
}