Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- from collections import Counter
- def simulate_mill(deck_size=60, land_count=24, mill_per_trigger=6, num_simulations=100_000, verbose_simulations=3):
- full_mill_count = 0
- total_milled_list = []
- for sim in range(num_simulations):
- # Initialize deck
- deck = ['L'] * land_count + ['S'] * (deck_size - land_count)
- random.shuffle(deck)
- milled_total = 0
- mill_round = 1
- verbose = sim < verbose_simulations
- if verbose:
- print(f"\n--- Simulation #{sim + 1} ---")
- while True:
- to_mill = min(mill_per_trigger, len(deck))
- if to_mill == 0:
- break
- milled = [deck.pop() for _ in range(to_mill)]
- milled_total += to_mill
- if verbose:
- mill_str = ''.join(milled)
- spell_count = Counter(milled)['S']
- if spell_count >= 2:
- print(f"Mill round {mill_round}: Reveals {mill_str} → Continue (found {spell_count} spell(s))")
- else:
- print(f"Mill round {mill_round}: Reveals {mill_str} → Stop (only {spell_count} spell(s))")
- spell_count = Counter(milled)['S']
- if spell_count < 2:
- break
- mill_round += 1
- total_milled_list.append(milled_total)
- if milled_total >= deck_size:
- full_mill_count += 1
- avg_milled = sum(total_milled_list) / num_simulations
- full_mill_percent = full_mill_count / num_simulations * 100
- print(f"\n=== Summary over {num_simulations} simulations ===")
- print(f"Average cards milled per draw: {avg_milled:.2f}")
- print(f"Full deck mill rate: {full_mill_percent:.2f}%")
- simulate_mill()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement