Hash

Hash

am 14.07.2006 23:27:42 von weberw

How 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'};
}

Re: Hash

am 14.07.2006 23:39:04 von rvtol+news

weberw@adelphia.net schreef:

> How do I make the current letters appear in this version of hangman?

Certainly not by multi-posting.

--
Affijn, Ruud

"Gewoon is een tijger."

Re: Hash

am 14.07.2006 23:39:32 von Sherm Pendley

"weberw@adelphia.net" writes:

> How do I make the current letters appear in this version of hangman?

You also posted this separately in c.l.p.misc. Please don't do that. This
isn't a modules question anyway.

sherm--

--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net