Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / games / hack / rnd.c
CommitLineData
984263bc
MD
1/* rnd.c - version 1.0.2 */
2/* $FreeBSD: src/games/hack/rnd.c,v 1.5 1999/11/16 10:26:38 marcel Exp $ */
1de703da 3/* $DragonFly: src/games/hack/rnd.c,v 1.2 2003/06/17 04:25:24 dillon Exp $ */
984263bc
MD
4
5#include <stdlib.h>
6
7#define RND(x) (random() % x)
8
9rn1(x,y)
10int x,y;
11{
12 return(RND(x)+y);
13}
14
15rn2(x)
16int x;
17{
18 return(RND(x));
19}
20
21rnd(x)
22int x;
23{
24 return(RND(x)+1);
25}
26
27d(n,x)
28int n,x;
29{
30 int tmp = n;
31
32 while(n--) tmp += RND(x);
33 return(tmp);
34}