From: Vincent Le Gallic Date: Wed, 16 May 2012 15:24:49 +0000 (+0200) Subject: certains mots ont des parenthèses X-Git-Url: http://gitweb.pimeys.fr/?p=bots%2Fhung.git;a=commitdiff_plain;h=7499b7e16fe2f3b20d40963a58114574f11fb530 certains mots ont des parenthèses --- diff --git a/hung.py b/hung.py index ea2a64c..5c7a672 100755 --- a/hung.py +++ b/hung.py @@ -281,7 +281,7 @@ class Hung(ircbot.SingleServerIRCBot): indice = random.randrange(0,len(mots)) mot,definition=mots[indice],defs[indice] # ' et - sont considérés comme déjà devinés - mot = [(lettre,lettre in "'-") for lettre in list(mot)] + mot = [(lettre,lettre in "'-()") for lettre in list(mot)] self.play_status[canal]=[mot,definition,{}] self.affiche_mot(serv, canal, begin="Devinez") @@ -338,8 +338,8 @@ class Hung(ircbot.SingleServerIRCBot): liste=self.play_status[canal][0] listeapres=[(lettre[0],lettre[1] or lettre[0]==giv_let) for lettre in liste] if liste!=listeapres: - nbtrouvees=(sum([lettre[1] for lettre in listeapres if not lettre[0] in "'-"]) - - sum([lettre[1] for lettre in liste if not lettre[0] in "'-"])) + nbtrouvees=(sum([lettre[1] for lettre in listeapres if not lettre[0] in "'-()"]) + - sum([lettre[1] for lettre in liste if not lettre[0] in "'-()"])) if self.play_status[canal][2].has_key(auteur): self.play_status[canal][2][auteur]+= nbtrouvees else: