Hash
am 14.07.2006 23:27:42 von weberwHow do I make the current letters appear in this version of hangman?
$current{word} = $cat
When the user enters c. I need it show c_ _.
sub processguess{
#hash of letters guessed
$current{letters} .= param('guess');
@guessed_letters = split('', $current{letters});
$current{letters} = join('', @guessed_letters);
return $current{'letters'};
my @word = split / /, $current{word};
$current{'revealed'} = join '',map {$current{letters}{$_} ? $_ : '_' }
$current{word} =~ /(.)/g;
return $current{'revealed'};
}