From 5728974ea24ebeb409f24183e51eb1f61cf1c838 Mon Sep 17 00:00:00 2001 From: James Vega Date: Thu, 5 Aug 2004 20:29:20 +0000 Subject: [PATCH] We only want to hide/count characters in string.ascii_lowercase --- plugins/Words.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/Words.py b/plugins/Words.py index 1542844bb..66b248efd 100644 --- a/plugins/Words.py +++ b/plugins/Words.py @@ -218,11 +218,12 @@ class Words(callbacks.Privmsg): game.guessed = False game.unused = copy.copy(self.validLetters) game.hidden = game.getWord() - game.guess = '_' * len(game.hidden) + game.guess = re.sub('[%s]' % string.ascii_lowercase, '_', + game.hidden) self._hangmanReply(irc, channel, 'Okay ladies and gentlemen, you have ' 'a %s-letter word to find, you have %s!' % - (len(game.hidden), game.triesLeft())) + (game.guess.count('_'), game.triesLeft())) # So, a game is going on, but let's see if it's timed out. If it is # we create a new one, otherwise we inform the user else: