summaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1997-09-24 22:29:08 +0000
committerache <ache@FreeBSD.org>1997-09-24 22:29:08 +0000
commit513b27d707a719622681efb710210a75b5801802 (patch)
treed5c5cf1f1c2a96c2ec08b9b2b801883813e5eea8 /games
parent8b97f3e687b490a2aa292b9e95b02cb4e06ade0f (diff)
downloadFreeBSD-src-513b27d707a719622681efb710210a75b5801802.zip
FreeBSD-src-513b27d707a719622681efb710210a75b5801802.tar.gz
Cleanup.
Convert to random()
Diffstat (limited to 'games')
-rw-r--r--games/worm/worm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/games/worm/worm.c b/games/worm/worm.c
index 8e6dcb9..edd80ab 100644
--- a/games/worm/worm.c
+++ b/games/worm/worm.c
@@ -49,7 +49,9 @@ static char sccsid[] = "@(#)worm.c 8.1 (Berkeley) 5/31/93";
#include <ctype.h>
#include <curses.h>
#include <signal.h>
+#include <stdlib.h>
#include <termios.h>
+#include <unistd.h>
#define newlink() (struct body *) malloc(sizeof (struct body));
#define HEAD '@'
@@ -93,7 +95,7 @@ main(argc, argv)
if ((start_len <= 0) || (start_len > 500))
start_len = LENGTH;
setbuf(stdout, outbuf);
- srand(getpid());
+ srandomdev();
signal(SIGALRM, wake);
signal(SIGINT, leave);
signal(SIGQUIT, leave);
@@ -178,7 +180,7 @@ wake()
rnd(range)
{
- return abs((rand()>>5)+(rand()>>5)) % range;
+ return random() % range;
}
newpos(bp)
OpenPOWER on IntegriCloud