Re: Dice Function

From: Mythran (
Date: 07/07/02

> > Why was the dice function written as it is?
> Because it actually simulates the rolling of a number of dice.  Your loop
> only chooses a random number between low and high, and thus changes the
> probabilities.
> The probability graph of 2-12 is different for "2d12" vs merely "2-12".
> And right away, that's a disadvantage.

Take a closer look at my post.  You will see that it is not a disadvantage
at all....

2d12 using the my dice() function has the same will not
return just 2-12.

In my dice function, dice(2, 12) will return a min of 2 and a max of
24....this is the same results that the stock dice function would return.

Notice the return statement:

return (number(num, num * size));



   | FAQ: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/25/03 PDT