|
|
|
|
|
|
| Author |
Message |
weberw@adelphia.net *nix forums beginner
Joined: 09 Jul 2006
Posts: 22
|
Posted: Fri Jul 14, 2006 9:27 pm Post subject:
Hash
|
|
|
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'};
} |
|
| Back to top |
|
 |
Dr.Ruud *nix forums Guru
Joined: 23 Sep 2005
Posts: 721
|
Posted: Fri Jul 14, 2006 9:39 pm Post subject:
Re: Hash
|
|
|
weberw@adelphia.net schreef:
| Quote: | How do I make the current letters appear in this version of hangman?
|
Certainly not by multi-posting.
--
Affijn, Ruud
"Gewoon is een tijger." |
|
| Back to top |
|
 |
Sherm Pendley *nix forums Guru
Joined: 03 Mar 2005
Posts: 527
|
Posted: Fri Jul 14, 2006 9:39 pm Post subject:
Re: Hash
|
|
|
"weberw@adelphia.net" <weberw@adelphia.net> writes:
| Quote: | 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 |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Sun Nov 23, 2008 1:16 pm | All times are GMT
|
|
Loans | Remortgaging | Remortgages | Loans | Advertising
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|