Berkeley header; comment out debugging code; remove setbuf call;
[unix-history] / usr / src / games / mille / roll.c
/*
* Copyright (c) 1982 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
#ifndef lint
static char sccsid[] = "@(#)roll.c 5.1 (Berkeley) %G%";
#endif not lint
# include "mille.h"
/*
* This routine rolls ndie nside-sided dice.
*
* @(#)roll.c 1.1 (Berkeley) 4/1/82
*
*/
roll(ndie, nsides)
reg int ndie, nsides; {
reg int tot;
extern unsigned int random();
tot = 0;
while (ndie--)
tot += random() % nsides + 1;
return tot;
}