[CoLoCo] dice rolls in C

Jim Hutchinson jim at ubuntu-rocks.org
Sat Feb 9 04:45:22 GMT 2008


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



More information about the Ubuntu-us-co mailing list