]> gitweb.pimeys.fr Git - bots/hung.git/commitdiff
certains mots ont des parenthèses
authorVincent Le Gallic <legallic@crans.org>
Wed, 16 May 2012 15:24:49 +0000 (17:24 +0200)
committerVincent Le Gallic <legallic@crans.org>
Wed, 16 May 2012 15:24:49 +0000 (17:24 +0200)
hung.py

diff --git a/hung.py b/hung.py
index ea2a64c843dec47a3a0bd5ad2a333de08d8c8b1a..5c7a672ec4470bd59ee42dff6a4b864948fdccc6 100755 (executable)
--- 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
         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")
 
         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:
                 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:
                     if self.play_status[canal][2].has_key(auteur):
                         self.play_status[canal][2][auteur]+= nbtrouvees
                     else: