[CoLoCo] dice rolls in C

Dale K. Hawkins dkhawk at gmail.com
Sat Feb 9 04:51:47 GMT 2008


drop the "+1" from the rand statements.  rand(10) returns 0 to 9.

-Dale

On Feb 8, 2008 9:45 PM, Jim Hutchinson <jim at ubuntu-rocks.org> wrote:

> On Feb 8, 2008 9:34 PM, Kenneth D. Weinert <kenw at quarter-flash.com> wrote:
> > change Array.new(13)  to Array.new(21)
> >
> > 13 = 6 + 6 + 1 -- the one is because of the zero base.
> >
> >
>
> Hey, worked. Thanks. One minor follow up. This reported totals from
> 2-20. I have some 10-sided dice and they are numbered 0-9 which would
> give totals from 0-18. Is there a way to make this do the same? I know
> it doesn't really matter but for consistency and clarity for a 6th
> grader it would help.
>
> By the way, I'm currently running 10billion rolls. I'm predicting it
> will take around 4 hours. I don't think I will want to try a trillion
> rolls :)
>
> Thanks,
> -jim
> --
> Please avoid sending me Word or PowerPoint attachments.
> See http://www.gnu.org/philosophy/no-word-attachments.html
>
> --
> Ubuntu-us-co mailing list
> Ubuntu-us-co at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-us-co
>



-- 
All creativity is an extended form of a joke.
- Alan Kay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/ubuntu-us-co/attachments/20080208/e82431b0/attachment.htm 


More information about the Ubuntu-us-co mailing list