chillmeter: prevent dupes

master
Casey Link 2011-09-08 15:50:13 -05:00
parent 4a475bd030
commit 2ae48cfb1b
1 changed files with 12 additions and 2 deletions

View File

@ -27,7 +27,10 @@ chill_words = [
"lax pinny",
"lacrosse",
"a bowl",
"slampiece"
"slampiece",
"smirnoff",
"ices",
"iced"
]
# words that unchill the place
@ -54,7 +57,8 @@ chill_things = [
("case of keystone", "cases of keystone"),
("fist bump", "fist bumps"),
("head nod", "head nods"),
("bro", "bros")
("bro", "bros"),
("bowl", "bowls")
]
# keeps a finger on the pulse of the chillness
@ -91,12 +95,18 @@ def chill(phenny, input):
n = random.randint(1,2)
items = []
used = set()
for i in range(n):
if level == 0:
amount = random.randint(5, 10)
else:
amount = random.randint(1, level)
item = random.choice(chill_things)
while item in used:
item = random.choice(chill_things)
used.add(item)
if amount == 1:
item = item[0] # singular
else: