Skip to content

Instantly share code, notes, and snippets.

@ribbanya
ribbanya / 2d6-opposed-probability.py
Last active September 28, 2017 17:18
2d6+a vs. 2d6+b Probability Simulator
import random
def main():
trials = 1000000
print_each_trial = False
reroll_if_tie = True
print('A', 'B', 'A%', 'B%', 'Tie%', sep='\t')
for a_mod in range(-3, 3 + 1):
for b_mod in range(-3, 3 + 1):
results = {'a' : 0, 'b' : 0, 'tie' : 0}