X-Git-Url: http://gitweb.pimeys.fr/?p=bots%2Fhung.git;a=blobdiff_plain;f=hung.py;h=c022105f9db7894f4825e846fed7fe0fc31a2eab;hp=dbeff29e5c60d0736ed6209c62eeaedfd195907d;hb=ef316a07c56a6da29cd4187cbc23effdcbf527c6;hpb=8429f696faa48f834b5583d3b80bc11809716423 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)