From 693d2549387a2762f3cd93ca84d24e981c123004 Mon Sep 17 00:00:00 2001 From: berryman Date: Thu, 6 Dec 2012 18:43:33 -0500 Subject: [PATCH] indentation error; create instance --- plugin.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/plugin.py b/plugin.py index 53c7922..2c8353a 100644 --- a/plugin.py +++ b/plugin.py @@ -1,16 +1,17 @@ from random import choice -class CardsAgainstHumanity: +class CardsAgainstHumanity(object): + def __init__(self): + self.answerDb = ["Coat hanger abortions", "Man meat", "Autocannibalism", "Vigorous jazz hands", "Flightless birds", "Pictures of boobs", "Doing the right thing", "Hunting accidents", "A cartoon camel enjoying the smooth", "The violation of our most basic human rights", "Viagra", "Self-loathing", "Spectacular abs", "An honest cop with nothing left to lose", "Abstinence", "A balanced breakfast", "Mountain Dew Code Red", "Concealing a boner", "Roofies", "Tweeting"] - __init__(self) - self.answerDb = ["Coat hanger abortions", "Man meat", "Autocannibalism", "Vigorous jazz hands", "Flightless birds", "Pictures of boobs", "Doing the right thing", "Hunting accidents", "A cartoon camel enjoying the smooth", "The violation of our most basic human rights", "Viagra", "Self-loathing", "Spectacular abs", "An honest cop with nothing left to lose", "Abstinence", "A balanced breakfast", "Mountain Dew Code Red", "Concealing a boner", "Roofies", "Tweeting"] + def drawCard(self): + hand = [] + while len(hand) < 5: + answerCard = choice(self.answerDb) + hand.append(answerCard) + self.answerDb.remove(answerCard) + return hand - def drawCard(self): - hand = [] - while len(hand) < 5: - answerCard = choice(self.answerDb) - hand.append(answerCard) - self.answerDb.remove(answerCard) - return hand +cah = CardsAgainstHumanity() -print drawCard() +print cah.drawCard()