Advertisement
Guest User

Mutator script

a guest
Oct 6th, 2014
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.75 KB | None | 0 0
  1. #!/usr/bin/python
  2. #
  3. # Usage:
  4. #
  5. # (0) Choose your games and check all
  6. # three mutators
  7. #
  8. # (1) Enter the amount under "you save"
  9. # (money, not percentage) into YOUSAVE1
  10. #
  11. # (2) Enter the cost of a single mutator
  12. # into SINGLE_MUTATOR
  13. #
  14. # (3) Click CHECKOUT NOW
  15. #
  16. # (4) Enter the amount under "you save"
  17. # into YOUSAVE2
  18. #
  19. # (5) Run script through Python interpreter
  20. #
  21. # Your amounts may differ due to local currency
  22. # (mine are in Euro, sorry about that).
  23.  
  24. YOUSAVE1=13.20
  25. SINGLE_MUTATOR=1.59
  26. YOUSAVE2=33.10
  27.  
  28. PRECISION=1e-6
  29.  
  30. from collections import Counter
  31. from sets import Set
  32.  
  33. def combo(val):
  34.     (i,j,k)=val
  35.     print("%.2f=%.2f+%.2f+%.2f"%(i+j+k,i,j,k))
  36.     for i in range(3):
  37.         print;
  38.         print("Possible game #%d:"%(i+1))
  39.         for j in a:
  40.             if a[j]==val[i]:
  41.                 print("%s"%j)
  42.  
  43. def printkeys(n):
  44.     for i in a:
  45.         if a[i]==n:
  46.             print(i,"\n")
  47.  
  48. a={'Megarace 1+2': 4.79,
  49.    'Cannon Fodder 2': 4.79,
  50.    'Banished': 15.89,
  51.    'Sword of the Samurai': 4.79,
  52.    'Rex Nebular': 4.79,
  53.    'Capitalism 2': 7.99,
  54.    'King of Dragon Pass': 4.79,
  55.    'Wing Commander 1+2': 4.79,
  56.    'Influx': 7.99,
  57.    'Fist Puncher': 7.99,
  58.    'Democracy 3': 19.89,
  59.    'Divinity: Dragon Commander Imperial Edition': 35.69,
  60.    'Blackwell Bundle': 11.89,
  61.    'Legend of Grimrock': 11.89,
  62.    'Eador: Genesis': 4.79,
  63.    'Hotline Miami': 7.99,
  64.    'Raven': 19.89,
  65.    'Dark Eye: Chains of Satinav': 15.89,
  66.    'Trine: Enchanted Edition': 11.89}
  67. vals=a.values()
  68. set=Set([])
  69.  
  70. mv=float(YOUSAVE2-YOUSAVE1+SINGLE_MUTATOR*3)
  71. for i in vals:
  72.     for j in vals:
  73.         for k in vals:
  74.             if (i<=j and j<=k and abs(mv-i-j-k)<PRECISION):
  75.                 set.add((i,j,k))
  76. for val in set:
  77.     combo(val)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement