mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-21 15:45:02 +00:00
Cleanup.
Convert to random()
This commit is contained in:
parent
2e1b5246d1
commit
7af643f5a3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=29827
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user