This commit is contained in:
Ben Harris committed 2018-10-09 02:50:10 -04:00
1 parent a8a5de36f2
commit 58753c7234
38 files changed
+4549 -2523

No files matched your search

+5 -4
View File
@@ -3,10 +3,11 @@ import re
quotefile = "/home/karlen/irc/quotes.txt"
def get_quote():
quotes = open(quotefile, "r").read().split("---")
quote,attr = random.choice(quotes).strip().splitlines()
quote = quote[:200] #get only the first 200 chars
word = random.choice([q for q in quote.split(' ') if len(q) > 1])
quote, attr = random.choice(quotes).strip().splitlines()
quote = quote[:200] # get only the first 200 chars
word = random.choice([q for q in quote.split(" ") if len(q) > 1])
quote = quote.replace(word, re.sub(r"[a-zA-Z]", "_", word))
return [word, "Fill in the blank: \"" + quote + "\" " + attr]
return [word, 'Fill in the blank: "' + quote + '" ' + attr]