Clear the direction flag (CLD) on entry to the kernel, to support future
[dragonfly.git] / games / hack / rnd.c
blobadf8d4cd71b272a8cb092264fe695de0f45ef226
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 $ */
3 /* $DragonFly: src/games/hack/rnd.c,v 1.3 2006/08/21 19:45:32 pavalos Exp $ */
5 #include "hack.h"
7 #define RND(x) (random() % x)
9 int
10 rn1(int x, int y)
12 return(RND(x)+y);
15 int
16 rn2(int x)
18 return(RND(x));
21 int
22 rnd(int x)
24 return(RND(x)+1);
27 int
28 d(int n, int x)
30 int tmp = n;
32 while(n--) tmp += RND(x);
33 return(tmp);