Skip to Content

Help with using AnyDice

2 replies [Last post]
releppes
Offline
Joined: 09/17/2010

I'm using AnyDice:

http://anydice.com/

to compare dice combat. What I'd like to do is get a visual on 3d6 vs 2d6. Meaning an attacker rolls 3 dice against a defender rolling 2 dice. What's the probability distribution of them winning.

I'm weighting the probability of point values for each dice as such:

A {1,2,3} yields 0 points
{4,5} yields 1 point
{6} yields 2 points

For example: A 3d6 roll of [1,4,6] would yield 3 points total.

I can get the point probability of rolling various amounts of dice by doing:

loop N over {1..5} {
output [count {4,5,6,6} in Nd6]
}

That gives me the point probabilities of rolling 1 to 5 dice. Now what I'd like to do is see how to compare point probabilities against each other. So if playerA was to roll 3 dice and playerB was to roll 2 dice, what would be the point distribution. In a 3d6 vs 2d6 scenario, I'd expect a point distribution in the range of [-4..6].

I'd eventually like to get a visual of all combinations Nd6 vs Md6 where N and M can be 1 to 5 dice.

Thanks for any help and/or examples.

releppes
Offline
Joined: 09/17/2010
Never mind. I just figured

Never mind. I just figured it out.

This is exactly what I wanted:

POINTS: {4,5,6,6}
output [count POINTS in 3d6] - [count POINTS in 2d6]

releppes
Offline
Joined: 09/17/2010
No doubt about it, AnyDice is

No doubt about it, AnyDice is awesome!

I spent the better part of a day figuring statistics in a spread sheet for this sort of example:

Attacker rolls [3,4,5] gets 1 point or [6] gets 2 points
Defender rolls [1,2] get 1 point

In this example, the attacker has an obvious advantage. I then proceeded to create an elaborate spread sheet for all the cases of Attacker vs the Defender. It did exactly what I wanted, but then I wanted to fiddle with more weighted point options. I had to tweak the spread sheet some and it got to be tedious after a while. I've been able to accomplish exactly what I wanted with a visual graph to boot using AnyDice. It took a while to figure out, but here's the result of all combinations of Nd6 vs Md6 for 1 to 3 dice:

ATTACK: {3,4,5,6,6}
DEFEND: {1,2}

loop N over {1..3} {
loop M over {1..3} {
output [count ATTACK in Nd6] - [count DEFEND in Md6] named "[N]d6 vs [M]d6"
}
}

Syndicate content


forum | by Dr. Radut