Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- warlocklevels = 0
- barbarianlevels = 0
- levelorder = ['b','w','b','w','w','w','w','b','w']
- con = 3
- hpIter = []
- times = 10000
- i = 0
- hpAverage = 0
- while i < times:
- hp = 0
- newDie = 0
- level = 1
- oldBarbDie = []
- oldWarDie = []
- for c in levelorder:
- found = 0
- for b in oldBarbDie:
- if (b < 7) and (found == 0):
- b = random.randint(1, 12)
- found = 1
- if found == 0:
- for w in oldWarDie:
- if w < 5 and found == 0:
- w = random.randint(1, 8)
- found = 1
- if level == 1:
- if c == 'b':
- oldBarbDie.append(12)
- else:
- oldWarDie.append(8)
- elif c == 'b':
- newDie = random.randint(1,12)
- if newDie == 1:
- newDie = random.randint(1,12)
- oldBarbDie.append(newDie)
- else:
- oldBarbDie.append(newDie)
- elif c == 'w':
- newDie = random.randint(1, 8)
- if newDie == 1:
- newDie = random.randint(1, 8)
- oldWarDie.append(newDie)
- else:
- oldWarDie.append(newDie)
- level = level + 1
- for hpB in oldBarbDie:
- hp = hp + hpB
- for hpW in oldWarDie:
- hp = hp + hpW
- hpIter.append(hp)
- i = i+1
- for t in hpIter:
- hpAverage = t+hpAverage
- print(hpAverage/times)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement