summaryrefslogtreecommitdiffstats
path: root/games/hack/rnd.c
blob: 037b2d9132600bc607d1604bdb6cc5eb4ecc7af3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* rnd.c - version 1.0.2 */
/* $FreeBSD$ */

#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);
}
OpenPOWER on IntegriCloud