Guest User

+14 Reblath Failstack Simulation

a guest
Jan 8th, 2019
1,143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.67 KB | None | 0 0
  1. import random
  2.  
  3. BLACK_STONE_COST = 210000
  4. DURABILITY_COST = 6450
  5. CLEANSE_COST = 100000
  6.  
  7. NUMBER_OF_RUNS = 1000000
  8. TARGET_STACK = 15
  9.  
  10. total_cost = 0
  11. runs = 0
  12.  
  13. while runs < NUMBER_OF_RUNS:
  14.     stack = 0    
  15.     while stack < TARGET_STACK:
  16.             total_cost += BLACK_STONE_COST
  17.            
  18.             if random.random() < (0.02 + (0.002 * stack)):
  19.                 #Enhance successful
  20.                 total_cost += CLEANSE_COST
  21.                 stack = 0
  22.             else:
  23.                 #Enhance failed
  24.                 total_cost += DURABILITY_COST
  25.                 stack += 1                      
  26.     runs += 1
  27.  
  28. print(round(total_cost/NUMBER_OF_RUNS, 0))
Advertisement
Add Comment
Please, Sign In to add comment