# How to model a roll against a "difficulty roll" in AnyDice?

I'm working on a custom ttrpg system and I've noticed a lot of answers to questions in here regarding AnyDice. You would roll two die (such as a d6 and a d8) against a third die of any size up to a d12. The third die determines difficulty. Having at least 1 die meet or exceed the difficulty is a minor success, while both meeting or exceeding is a major success. Any help on how to set this up would be appreciated.

• Welcome to RPG.SE! Take the tour if you haven't already and see the help center or ask us here in the comments (use @ to ping someone) if you need more guidance. Good Luck and Happy Gaming! Jul 19, 2023 at 8:04

function: roll A:n B:n against T:n {

• It might be worth noting that the A:n B:n part of the definition causes each of the first two rolls to be summed into a single number even if there's more than one die in each rolled pool. If you defined the function using A:s B:s, the rolls would be converted into sequences instead, which would let you do e.g. [roll 2d8 3d6 against d12] and get a count ranging from zero to 2 + 3 = 5 of all the dice in 2d8 and 3d6 meeting or exceeding the random d12 target. Jul 19, 2023 at 21:42