diff options
author | christos <christos@NetBSD.org> | 1997-10-19 16:56:41 +0000 |
---|---|---|
committer | christos <christos@NetBSD.org> | 1997-10-19 16:56:41 +0000 |
commit | 84e7d0704483ce39bbdeacd5e676168db6fa664f (patch) | |
tree | f9ffeffa1a4342e749494bc3f5618552435839af /hack/rnd.c | |
parent | f73f1009084e75624e3bc00fef9cf4749de80dcc (diff) | |
download | bsdgames-darwin-84e7d0704483ce39bbdeacd5e676168db6fa664f.tar.gz bsdgames-darwin-84e7d0704483ce39bbdeacd5e676168db6fa664f.tar.zst bsdgames-darwin-84e7d0704483ce39bbdeacd5e676168db6fa664f.zip |
WARNsify...
Diffstat (limited to 'hack/rnd.c')
-rw-r--r-- | hack/rnd.c | 40 |
1 files changed, 26 insertions, 14 deletions
@@ -1,32 +1,44 @@ +/* $NetBSD: rnd.c,v 1.4 1997/10/19 16:59:39 christos Exp $ */ + +#include <sys/cdefs.h> #ifndef lint -static char rcsid[] = "$NetBSD: rnd.c,v 1.3 1995/03/23 08:32:28 cgd Exp $"; -#endif /* not lint */ +__RCSID("$NetBSD: rnd.c,v 1.4 1997/10/19 16:59:39 christos Exp $"); +#endif /* not lint */ + +#include <stdlib.h> +#include "hack.h" +#include "extern.h" #define RND(x) ((random()>>3) % x) -rn1(x,y) -register x,y; +int +rn1(x, y) + int x, y; { - return(RND(x)+y); + return (RND(x) + y); } +int rn2(x) -register x; + int x; { - return(RND(x)); + return (RND(x)); } +int rnd(x) -register x; + int x; { - return(RND(x)+1); + return (RND(x) + 1); } -d(n,x) -register n,x; +int +d(n, x) + int n, x; { - register tmp = n; + int tmp = n; - while(n--) tmp += RND(x); - return(tmp); + while (n--) + tmp += RND(x); + return (tmp); } |