Calculating the probability of two dice rolls in a simple game

71 Views Asked by At

I am developing a game in which the player has to roll two dice and add the result with an attribute of his character, the result of this sum is finally compared to the difficulty value of the task that the character will perform, for being successful or to be fail in the task.

For example:

first die value + second die value + attribute value >= difficulty value
       2         +          3        +       4         >=       10       // Character failed  
       4         +          4        +       4         >=       10       // Character was successful

Which formula can I use to calculate the probability of the player being successful, that is, the value taken from the dices plus the attribute value being greater than or equal to the difficulty of the task

My goal is to show the player for example: "You have a 35% chance of performing this task"

EDIT: There are two rules that I don't know if it influences the final result: If you score 6 and 6 on the dices you always win or if you take 1 and 1 you always lose, regardless of the sum total