Dice Roll Probabilities - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18) +---- Forum: PHP The Hypertext Preprocessor (https://www.supportforums.net/forumdisplay.php?fid=21) +---- Thread: Dice Roll Probabilities (/showthread.php?tid=2641) |
Dice Roll Probabilities - zone - 11-07-2009 Credits and Source: http://www.dreamincode.net/ Name: Dice Roll Probabilities Description: A function which given n, m-sided dice returns an array with the probabilities of each collective score. Snippet: PHP Code: function dieOdds($dieType, $dieMax = null, $scale = null, $truncate = null){ Instructions: Just copy and paste this function into your code. It works with BCMath function in order to handle large probabilities such as 20d6. Returns an array. Thankyou for reading. Be happy always |