From 2ae48cfb1bfba4504369ea219309fb1c8ee7f0ca Mon Sep 17 00:00:00 2001 From: Casey Link Date: Thu, 8 Sep 2011 15:50:13 -0500 Subject: [PATCH] chillmeter: prevent dupes --- modules/chillmeter.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/chillmeter.py b/modules/chillmeter.py index 8b4ee82..d89fe65 100644 --- a/modules/chillmeter.py +++ b/modules/chillmeter.py @@ -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: