freebsd-dev/games/hack/rnd.c

34 lines
290 B
C
Raw Normal View History

/* rnd.c - version 1.0.2 */
1999-11-16 02:45:03 +00:00
/* $FreeBSD$ */
1997-09-24 05:18:42 +00:00
#include <stdlib.h>
#define RND(x) (random() % x)
rn1(x,y)
int x,y;
{
return(RND(x)+y);
}
rn2(x)
int x;
{
return(RND(x));
}
rnd(x)
int x;
{
return(RND(x)+1);
}
d(n,x)
int n,x;
{
int tmp = n;
while(n--) tmp += RND(x);
return(tmp);
}