From ef316a07c56a6da29cd4187cbc23effdcbf527c6 Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Sat, 8 Jun 2013 19:11:47 +0200 Subject: [PATCH] On utiliser les non_guess_chars aussi pour calculer les % de contribution. --- hung.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hung.py b/hung.py index dbeff29..c022105 100755 --- a/hung.py +++ b/hung.py @@ -512,7 +512,7 @@ class Hung(ircbot.SingleServerIRCBot): def gagne(self, serv, canal, bonus=None, bonusvalue=2): serv.privmsg(canal,"Bravo !") realword = self.reveal_word(serv, canal) - nlettre=float(len(realword.replace("'","").replace("-",""))) + nlettre=float(len([l for l in realword if not l in config.non_guess_chars])) contribs=["%s:%s%%%s"%(pseudo,str(int(100*contrib/nlettre)),("+bonus(%s)"%(bonusvalue))*(bonus==pseudo)) for pseudo,contrib in self.play_status[canal][2].items()] contribs_score={pseudo:int(10*contrib/nlettre) for pseudo,contrib in self.play_status[canal][2].items()} self.add_score(contribs_score) -- 2.39.2