Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re(3): Generating random 6 digit numbers

by Arien (Pilgrim)
on Aug 25, 2002 at 18:04 UTC ( [id://192702]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Generating random 6 digit numbers
in thread Generating random 6 digit numbers

Sure, that makes sense. In that case uniqueness seems to be of greater importance than true randomness: you just don't want the numbers to be easily guessable, correct?

One solution is to shuffle the numbers in this range and pop or shift one every time, as sauoq mentions above.

If this solution is desirable or not depends on what you are trying to achieve. How many numbers of those in your range will you issue? How hard do you want to make "guessing" a correct number? What are the consequences of "guessing" a valid number? These are some things to keep in mind.

— Arien

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2025-02-07 04:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (94 votes). Check out past polls.