snoonetIRC / CloudBot

CloudBot - The simple, fast, expandable, open-source Python IRC Bot!
GNU General Public License v3.0
67 stars 52 forks source link

Dice roll math possibly inaccurate #387

Open linuxdaemon opened 5 years ago

linuxdaemon commented 5 years ago

We currently can not prove that https://github.com/snoonetIRC/CloudBot/blob/7c210ddc5cd650fb562cc3cfb7a160151478858c/plugins/gaming.py#L54-L57 fairly calculates the sum of count rolls of n-sided dice. This method for 'faking' the rolls may be able to be cleaned up and improved.

Zowlyfon commented 5 years ago

I've looked over the formula and it seems to be accurate, although random.gaussian is faster according to the library documentation.

The first argument is the mean result, while the second argument is the standard deviation, the sum of dice rolls follow a normal distribution.