* Copyright (c) 1980 Regents of the University of California.
* %sccs.include.redist.c%
static char sccsid
[] = "@(#)roll.c 5.5 (Berkeley) %G%";
* This routine rolls ndie nside-sided dice.
# if !defined(vax) && !defined(tahoe)
return (int) ((tot
* (long) nsides
) / ((long) MAXRAND
+ 1)) + ndie
;
tot
+= (r
= rand()) * (num_sides
/ 017777777777) + 1;