Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def chooseOneLetter(base1, base2):
- ratio = 10
- seed = int(random.uniform (0, ratio*len(base1)+len(base2)))
- if seed < ratio*len(base1):
- #print("SIAL1")
- #print(int(seed/ratio))
- chosenLetter = base1[int(seed/ratio)]
- base1.remove(chosenLetter)
- else:
- #print("SIAL2")
- #print(seed - ratio*len(base1))
- chosenLetter = base2[(seed - ratio*len(base1))]
- base2.remove(chosenLetter)
- return chosenLetter
- def getSecretCode(base1, base2):
- #print("new run")
- secretCode = ""
- for i in range(4):
- chosenLetter = chooseOneLetter(base1, base2)
- secretCode += chosenLetter
- return secretCode
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement