summaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1997-09-24 22:33:22 +0000
committerache <ache@FreeBSD.org>1997-09-24 22:33:22 +0000
commit518e6e69bd606782d2c6d77cd02fcf268ee4736f (patch)
tree5f90ef80ec576868d37ba2ac3abf18b6f9350c35 /games
parent513b27d707a719622681efb710210a75b5801802 (diff)
downloadFreeBSD-src-518e6e69bd606782d2c6d77cd02fcf268ee4736f.zip
FreeBSD-src-518e6e69bd606782d2c6d77cd02fcf268ee4736f.tar.gz
Convert to random()
Cleanup
Diffstat (limited to 'games')
-rw-r--r--games/robots/main.c3
-rw-r--r--games/robots/rnd_pos.c5
2 files changed, 4 insertions, 4 deletions
diff --git a/games/robots/main.c b/games/robots/main.c
index ee0adbc..936007c 100644
--- a/games/robots/main.c
+++ b/games/robots/main.c
@@ -43,6 +43,7 @@ static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
# include "robots.h"
# include <signal.h>
+# include <stdlib.h>
# include <ctype.h>
main(ac, av)
@@ -128,7 +129,7 @@ char **av;
stdscr = newwin(Y_SIZE, X_SIZE, 0, 0);
}
- srand(getpid());
+ srandomdev();
if (Real_time)
signal(SIGALRM, move_robots);
do {
diff --git a/games/robots/rnd_pos.c b/games/robots/rnd_pos.c
index f61609a..348bf35 100644
--- a/games/robots/rnd_pos.c
+++ b/games/robots/rnd_pos.c
@@ -35,6 +35,7 @@
static char sccsid[] = "@(#)rnd_pos.c 8.1 (Berkeley) 5/31/93";
#endif /* not lint */
+# include <stdlib.h>
# include "robots.h"
# define IS_SAME(p,y,x) ((p).y != -1 && (p).y == y && (p).x == x)
@@ -62,7 +63,5 @@ rnd_pos()
rnd(range)
int range;
{
- unsigned int rand();
-
- return rand() % range;
+ return random() % range;
}
OpenPOWER on IntegriCloud