Advertisement
Guest User

Gruul 15/18/4/24 6 mill Sphinx's tutelage

a guest
Jun 8th, 2025
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. import random
  2. from collections import Counter
  3.  
  4. def simulate_mill_realistic_gruul(deck_size=60, red=15, green=18, redgreen=4, lands=23, 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. # Deck contains single- and multicolor cards
  10. deck = ['R'] * red + ['G'] * green + ['RG'] * redgreen + ['L'] * lands
  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. # Tally color presence
  29. color_counts = {'R': 0, 'G': 0}
  30. for card in milled:
  31. if card == 'R':
  32. color_counts['R'] += 1
  33. elif card == 'G':
  34. color_counts['G'] += 1
  35. elif card == 'RG':
  36. color_counts['R'] += 1
  37. color_counts['G'] += 1
  38. # Lands are ignored
  39.  
  40. has_color_pair = any(count >= 2 for count in color_counts.values())
  41.  
  42. if verbose:
  43. mill_str = ','.join(milled)
  44. if has_color_pair:
  45. print(f"Mill round {mill_round}: Reveals [{mill_str}] → Continue (color pair found)")
  46. else:
  47. print(f"Mill round {mill_round}: Reveals [{mill_str}] → Stop (no color pair)")
  48.  
  49. if not has_color_pair:
  50. break
  51.  
  52. mill_round += 1
  53.  
  54. total_milled_list.append(milled_total)
  55. if milled_total >= deck_size:
  56. full_mill_count += 1
  57.  
  58. avg_milled = sum(total_milled_list) / num_simulations
  59. full_mill_percent = full_mill_count / num_simulations * 100
  60.  
  61. print(f"\n=== Summary over {num_simulations} simulations ===")
  62. print(f"Average cards milled per draw: {avg_milled:.2f}")
  63. print(f"Full deck mill rate: {full_mill_percent:.2f}%")
  64.  
  65. simulate_mill_realistic_gruul()
  66.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement