mirror of
https://github.com/RussellChamp/tilde-projects.git
synced 2026-10-28 00:22:34 +00:00
Added some puzzle thingsy
This commit is contained in:
1 parent
746f1091bb
commit
4fa28ac636
4 files changed
+43
-1
No files matched your search
@@ -0,0 +1,12 @@
|
||||
import random
|
||||
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 = quote.replace(word, re.sub(r"[a-zA-Z]", "_", word))
|
||||
return [word, "Fill in the blank: \"" + quote + "\" " + attr]
|
||||
Reference in new issue
Block a user