1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-21 15:45:02 +00:00
freebsd/games/hack/rnd.c

31 lines
282 B
C
Raw Normal View History

/* rnd.c - version 1.0.2 */
#define RND(x) ((random()>>3) % 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);
}