I know we have a few programmers and web designers on here, and I was wondering if any of you would be willing to help me out with a small Javascript project that's not functioning properly.
Here's the page in question.
It's meant to calculate dice probabilities for an RPG system I've been working on. It's a pretty simple calculation because each die always has a 50/50 chance of success, and the only thing that matters is counting successes. However, any time the "number of dice" input is above 10, and the "number of successes needed" input is anything other than 1, 0, or equal to the dice (which all have special cases plugged in), it returns 0.
For example, if you tell it you need 3 successes on 10 dice, it will tell you there's a 0% chance of success. It should tell you something like 94.53%.
Anyone willing/able to find the problem here?
Here's the page in question.
It's meant to calculate dice probabilities for an RPG system I've been working on. It's a pretty simple calculation because each die always has a 50/50 chance of success, and the only thing that matters is counting successes. However, any time the "number of dice" input is above 10, and the "number of successes needed" input is anything other than 1, 0, or equal to the dice (which all have special cases plugged in), it returns 0.
For example, if you tell it you need 3 successes on 10 dice, it will tell you there's a 0% chance of success. It should tell you something like 94.53%.
Anyone willing/able to find the problem here?
Comment