057afceb86
of the x11 based games. I'm not going to tag the originals with bsd_44_lite and do this in two stages since it's just not worth it for this collection, and I've got directory renames to deal with that way. Bleah. Submitted by: jkh
31 lines
282 B
C
31 lines
282 B
C
/* rnd.c - version 1.0.2 */
|
|
|
|
#define RND(x) ((random()>>3) % x)
|
|
|
|
rn1(x,y)
|
|
register x,y;
|
|
{
|
|
return(RND(x)+y);
|
|
}
|
|
|
|
rn2(x)
|
|
register x;
|
|
{
|
|
return(RND(x));
|
|
}
|
|
|
|
rnd(x)
|
|
register x;
|
|
{
|
|
return(RND(x)+1);
|
|
}
|
|
|
|
d(n,x)
|
|
register n,x;
|
|
{
|
|
register tmp = n;
|
|
|
|
while(n--) tmp += RND(x);
|
|
return(tmp);
|
|
}
|