Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: permutations?

by plaid (Chaplain)
on Jun 14, 2000 at 00:38 UTC ( #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
Node Status?
node history
Node Type: note [id://17977]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (12)
As of 2020-06-03 10:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (22 votes). Check out past polls.

    Notices?