Advertisement
Guest User

Mono color 6 mill Sphinx's tutelage

a guest
Jun 8th, 2025
12
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. import random
  2. from collections import Counter
  3.  
  4. def simulate_mill(deck_size=60, land_count=24, mill_per_trigger=6, num_simulations=100_000, verbose_simulations=3):
  5. full_mill_count = 0
  6. total_milled_list = []
  7.  
  8. for sim in range(num_simulations):
  9. # Initialize deck
  10. deck = ['L'] * land_count + ['S'] * (deck_size - land_count)
  11. random.shuffle(deck)
  12.  
  13. milled_total = 0
  14. mill_round = 1
  15. verbose = sim < verbose_simulations
  16.  
  17. if verbose:
  18. print(f"\n--- Simulation #{sim + 1} ---")
  19.  
  20. while True:
  21. to_mill = min(mill_per_trigger, len(deck))
  22. if to_mill == 0:
  23. break
  24.  
  25. milled = [deck.pop() for _ in range(to_mill)]
  26. milled_total += to_mill
  27.  
  28. if verbose:
  29. mill_str = ''.join(milled)
  30. spell_count = Counter(milled)['S']
  31. if spell_count >= 2:
  32. print(f"Mill round {mill_round}: Reveals {mill_str} → Continue (found {spell_count} spell(s))")
  33. else:
  34. print(f"Mill round {mill_round}: Reveals {mill_str} → Stop (only {spell_count} spell(s))")
  35.  
  36. spell_count = Counter(milled)['S']
  37. if spell_count < 2:
  38. break
  39.  
  40. mill_round += 1
  41.  
  42. total_milled_list.append(milled_total)
  43. if milled_total >= deck_size:
  44. full_mill_count += 1
  45.  
  46. avg_milled = sum(total_milled_list) / num_simulations
  47. full_mill_percent = full_mill_count / num_simulations * 100
  48.  
  49. print(f"\n=== Summary over {num_simulations} simulations ===")
  50. print(f"Average cards milled per draw: {avg_milled:.2f}")
  51. print(f"Full deck mill rate: {full_mill_percent:.2f}%")
  52.  
  53. simulate_mill()
  54.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement