Please Help - WEB Application

C

Chuck Insight

Hi Everyone,

I have a VB script (.aspx) project that needs to produce nine unique,
randomly generated numbers that uses all nine of the numbers. I will greatly
appreciate either a recommendation of where to look on the web for my
answer, or your direct response.

Thanks a 1,000,000 for your ideas.
Chuck
 
H

Hans Kesting

Chuck said:
Hi Everyone,

I have a VB script (.aspx) project that needs to produce nine unique,
randomly generated numbers that uses all nine of the numbers. I will greatly
appreciate either a recommendation of where to look on the web for my
answer, or your direct response.

Thanks a 1,000,000 for your ideas.
Chuck

If I understand correctly, you want to generate a nine-digit
"random" code that uses all of the digits in 123456789.
(what about "0"?)

What you can do is
1) start with "123456789"
2) generate two random numbers from 0 to 8 (inclusive)
3) exchange the digits at those positions
4) repeat steps 2) and 3) a dozen times.

To generate a random number, see the System.Random class
(create *one* instance, then repeatedly get random numbers
from that class)

To generate nine of these codes, use this repeatedly
but check if you already have this particular code. If
yes, discard this code and generate again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top