Returns a random word from WORDS that isn't in blocklist.
(blocklist=None)
| 95 | |
| 96 | |
| 97 | def getOneWordExcept(blocklist=None): |
| 98 | """Returns a random word from WORDS that isn't in blocklist.""" |
| 99 | if blocklist == None: |
| 100 | blocklist = [] |
| 101 | |
| 102 | while True: |
| 103 | randomWord = random.choice(WORDS) |
| 104 | if randomWord not in blocklist: |
| 105 | return randomWord |
| 106 | |
| 107 | |
| 108 | def numMatchingLetters(word1, word2): |