Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Is there an easy way to assign guaranteed unique values to a simple array without looping through whole array?

by traveler (Parson)
on Nov 30, 2007 at 00:08 UTC ( #654011=note: print w/ replies, xml ) Need Help??


in reply to Is there an easy way to assign guaranteed unique values to a simple array without looping through whole array?

Another way to look at this is that you want a shuffled version of some list. Take (1..7) for example. With Algorithm::Numerical::Shuffle you can do that easily:

@array = shuffle(1..7);
The idea of shuffling an array has been discussed before (and other places, too).

HTH, --traveler


Comment on Re: Is there an easy way to assign guaranteed unique values to a simple array without looping through whole array?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2014-07-13 08:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (248 votes), past polls