Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- cthun = int(input('Attack of Cthun: '))
- healthplayer = int(input('Enemy HP: '))
- amountminions= int(input('How many enemy minions are there on the board? '))
- minions = [healthplayer]
- for i in range(1,amountminions+1):
- minions.append(int(input('HP of this minion: ')))
- ave_life = [0.0 for x in range(len(minions))]
- targets = [x for x in range(len(minions))]
- num_trials = 10
- for i in range(num_trials):
- temp_minions = minions[:]
- temp_targets = targets[:]
- for j in range(cthun):
- targ = random.choice(temp_targets)
- temp_minions[targ] -= 1
- if temp_minions[targ] < 1:
- temp_targets.remove(targ)
- if temp_targets == []:
- print "All minions and player killed!"
- break
- for i in targets:
- ave_life[i] += float(temp_minions[i])/num_trials
- print ave_life
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement