diff --git a/analyze.py b/analyze.py index 31fda1e..25cd977 100644 --- a/analyze.py +++ b/analyze.py @@ -10,8 +10,8 @@ def h(n, z, x, y): def draw_probability(available, deck, count=1, turn=1, used=0): if count == 0: - return h(0, 7 + turn - 1 - used, available, len(deck)) - total = sum([h(n, 7 + turn - 1 - used, available, len(deck)) for n in range(count)]) + return h(0, 7 + turn - 1 - used, available, deck) + total = sum([h(n, 7 + turn - 1 - used, available, deck) for n in range(count)]) return 1 - total def graph(data, title, hideEmpty=True): @@ -53,8 +53,8 @@ def rampup(deck, type=None): avgCost = int(round(avgCost)) for turn in range(avgCost, maxCost + 1): castable = [c for c in cards if c.cost.converted() <= turn] - pm = 1 - draw_probability(len(land), deck, avgCost, turn) - pc = 1 - draw_probability(len(castable), deck, 1, turn, avgCost) + pm = 1 - draw_probability(len(land), len(deck), avgCost, turn) + pc = 1 - draw_probability(len(castable), len(deck), 1, turn, avgCost) p = 1 - pm - pc print 'Probability of drawing {0} mana in {1} turns with a castable {3}: {2:.3f}'.format(avgCost, turn, p * 100, type if type else 'spell') def types(deck):