Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: permutations?

by plaid (Chaplain)
on Jun 14, 2000 at 00:38 UTC ( [id://17977]=note: print w/replies, xml ) Need Help??


in reply to permutations?

You say that order is unimportant, but do you mean that the sentences can be in any order at all? You're using a hash reference to store the keys 'lng', 'sentance', and 'thxs', but hashes don't preserve any order whatsoever, so you're likely not going to get the keys in the same order you entered them into $words. If you want to keep the sentence parts in the same order, you might want to instead make it an array reference
my $words = [ ['lang', 'long', 'leng', 'loo'], ['sentence'], ['this', 'thus'] ];

Replies are listed 'Best First'.
RE: Re: permutations?
by eduardo (Curate) on Jun 14, 2000 at 00:44 UTC
    the order of the words isn't important at all, as long as one word from every key becomes part of each candidate answer... and unfortunately they are being passed to me as a hash of lists, so, i have to deal with them that way. (from another object) however, in the answer i can definetly mangle it any way we see fit...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://17977]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-03-29 06:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found