freebsd-skq/games/hack/rnd.c

34 lines
270 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)
x,y;
{
return(RND(x)+y);
}
rn2(x)
x;
{
return(RND(x));
}
rnd(x)
x;
{
return(RND(x)+1);
}
d(n,x)
n,x;
{
tmp = n;
while(n--) tmp += RND(x);
return(tmp);
}