JohnStabler
New member
- Joined
- Aug 14, 2017
- Messages
- 2
Hi,
I've seen similar problems stated in various places on the web, but not my exact problem. I'd be grateful for any help.
I'm developing a card game where players need to roll a certain number of dice and match numbers (or ranges of numbers) on cards. For example a card says the player rolls 5 dice and needs to roll one (6) and one (5 or 6). Another example would be the player rolls 6 dice and needs to get three (3 or 4).
I need to calculate the probability of a successful roll given any number of dice and specifying winning matches. This seems to be made more difficult by the allowing matches to be multiple sides of the dice.
I would like to write a code function so if you pass the number of dice and a list of integers (each integer is the number of sides that would match) then it would return the probability.
Thanks in advance,
John
I've seen similar problems stated in various places on the web, but not my exact problem. I'd be grateful for any help.
I'm developing a card game where players need to roll a certain number of dice and match numbers (or ranges of numbers) on cards. For example a card says the player rolls 5 dice and needs to roll one (6) and one (5 or 6). Another example would be the player rolls 6 dice and needs to get three (3 or 4).
I need to calculate the probability of a successful roll given any number of dice and specifying winning matches. This seems to be made more difficult by the allowing matches to be multiple sides of the dice.
I would like to write a code function so if you pass the number of dice and a list of integers (each integer is the number of sides that would match) then it would return the probability.
Thanks in advance,
John