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 ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://654011]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-04-16 20:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found