From fe76587a601c61d148567fe439c2689010b94ed2 Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Fri, 7 Jul 2017 14:40:44 +0200 Subject: [PATCH] Fail float/int + compter le bonus qu'on annonce, c'est mieux --- hung.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hung.py b/hung.py index 52f725b..2c3e708 100755 --- a/hung.py +++ b/hung.py @@ -531,7 +531,7 @@ class Hung(ircbot.SingleServerIRCBot): realword = self.reveal_word(serv, canal) 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()} + contribs_score={pseudo:int(10.0*contrib/nlettre)+(bonusvalue*(bonus==pseudo)) for pseudo,contrib in self.play_status[canal][2].items()} self.add_score(contribs_score) serv.privmsg(canal,"Contributions : %s"%(" ".join(contribs)) ) self.play_status[canal]=[None,None,None] -- 2.39.2