niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » Perl » modules
Hash
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
Author Message
weberw@adelphia.net
*nix forums beginner


Joined: 09 Jul 2006
Posts: 22

PostPosted: Fri Jul 14, 2006 9:27 pm    Post subject: Hash Reply with quote

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

PostPosted: Fri Jul 14, 2006 9:39 pm    Post subject: Re: Hash Reply with quote

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

PostPosted: Fri Jul 14, 2006 9:39 pm    Post subject: Re: Hash Reply with quote

"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
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
The time now is Sun Nov 23, 2008 1:16 pm | All times are GMT
navigation Forum index » Programming » Perl » modules
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts invalid hash entry in internal DNS code causes assertion ... Bertold Kolics Squid 0 Thu Jul 20, 2006 7:56 pm
No new posts What is the global hash %_ ? ozarfreo@yahoo.com Perl 12 Mon Jul 17, 2006 10:31 pm
No new posts Problem with anonymous array in hash bernd Perl 3 Mon Jul 17, 2006 10:38 am
No new posts General Hash Functions In Python Arash Partow python 12 Mon Jul 17, 2006 6:02 am
No new posts Hash weberw@adelphia.net Perl 2 Fri Jul 14, 2006 9:28 pm

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
[ Time: 0.1202s ][ Queries: 20 (0.0484s) ][ GZIP on - Debug on ]