1985-01-21 12:47:04 +00:00
|
|
|
/* $Header$ */
|
1984-11-29 14:22:02 +00:00
|
|
|
|
1985-01-21 12:37:26 +00:00
|
|
|
_randomi()
|
1984-11-29 14:22:02 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
double f;
|
1985-01-21 12:37:26 +00:00
|
|
|
_setchan(-1);
|
1984-11-29 14:22:02 +00:00
|
|
|
printf("Random number seed (-32768 to 32767) ? ");
|
|
|
|
_readint(&i);
|
|
|
|
f=i;
|
1985-01-21 12:37:26 +00:00
|
|
|
_setrand(f);
|
1984-11-29 14:22:02 +00:00
|
|
|
}
|
|
|
|
|
1985-01-21 12:37:26 +00:00
|
|
|
_setrand(f)
|
1984-11-29 14:22:02 +00:00
|
|
|
double f;
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
i=f;
|
|
|
|
srand(i);
|
|
|
|
}
|
|
|
|
double _rnd(d) double d;
|
|
|
|
{
|
|
|
|
double f; f= (int) rand();
|
|
|
|
return(f/32767.0);
|
|
|
|
}
|