diff options
| author | dholland <dholland@NetBSD.org> | 2009-07-20 06:43:18 +0000 |
|---|---|---|
| committer | dholland <dholland@NetBSD.org> | 2009-07-20 06:43:18 +0000 |
| commit | bfb149ab182f4c873c3c8eed8a00bdb81539513a (patch) | |
| tree | 85c024ddd0fdbcfb6334626e4d1baaf9f36d9d42 /robots/rnd_pos.c | |
| parent | c723a928778be55849c00d5cc692bf522bb8dae3 (diff) | |
| download | bsdgames-darwin-bfb149ab182f4c873c3c8eed8a00bdb81539513a.tar.gz bsdgames-darwin-bfb149ab182f4c873c3c8eed8a00bdb81539513a.zip | |
Use random() instead of rand(), and seed with time instead of pid.
Diffstat (limited to 'robots/rnd_pos.c')
| -rw-r--r-- | robots/rnd_pos.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/robots/rnd_pos.c b/robots/rnd_pos.c index e5a0b4c3..65baea60 100644 --- a/robots/rnd_pos.c +++ b/robots/rnd_pos.c @@ -1,4 +1,4 @@ -/* $NetBSD: rnd_pos.c,v 1.8 2009/07/20 06:39:06 dholland Exp $ */ +/* $NetBSD: rnd_pos.c,v 1.9 2009/07/20 06:43:18 dholland Exp $ */ /* * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)rnd_pos.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: rnd_pos.c,v 1.8 2009/07/20 06:39:06 dholland Exp $"); +__RCSID("$NetBSD: rnd_pos.c,v 1.9 2009/07/20 06:43:18 dholland Exp $"); #endif #endif /* not lint */ @@ -67,5 +67,5 @@ int rnd(int range) { - return rand() % range; + return random() % range; } |
