Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rings = 0
- from random import random
- socketchance = 0.1
- ringchance = 0.2
- l=[]
- count = 0
- while True:
- if random() < ringchance:
- if random() < socketchance:
- rings += 1
- if random() < ringchance:
- if random() < socketchance:
- rings += 1
- if random() < ringchance:
- if random() < socketchance:
- rings += 1
- count += 1
- if rings >= 5:
- # print ("Mecha done for the whole group in", count, "runs")
- l.append(count)
- print (sum(l)/len(l))
- rings = 0
- count = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement