mirror of
https://github.com/RussellChamp/tilde-projects.git
synced 2026-10-28 00:22:34 +00:00
Some new features and fixes for banterbot and topicbot. update to chatcloud
This commit is contained in:
1 parent
3da5e4073c
commit
e9fc646207
10 files changed
+187
-32
No files matched your search
@@ -13,3 +13,13 @@ def get_puzzle():
|
||||
words.sort()
|
||||
answer = words[key]
|
||||
return [answer, puzzle]
|
||||
|
||||
def get_anagram(maxlen = 6):
|
||||
dict_words = [word.rstrip() for word in open(dictionary).readlines() if "'" not in word and len(word) > 2 and len(word) <= maxlen+1]
|
||||
word = random.choice(dict_words)
|
||||
while True:
|
||||
anagram = ''.join(random.sample(word, len(word)))
|
||||
if anagram != word:
|
||||
break
|
||||
puzzle = "Unscramble the following word: '" + anagram + "'"
|
||||
return [word, puzzle]
|
||||
Reference in new issue
Block a user