Fun with Random numbers

# Thread: Fun with Random numbers

1. Kentium Guest

## Fun with Random numbers

Got a quick for you genius-types....<BR><BR>Consider this-<BR><BR>Dim randomamp, randomvis1, randomvis2<BR>Randomize &#039; Initialize random-number generator. <BR><BR>randomamp = Int((2 * Rnd) + 1) &#039; Generate random value between 1 and 2<BR>randomvis1 = Int((6 * Rnd) + 1) &#039; Generate random value between 1 and 6<BR>randomvis2 = Int((6 * Rnd) + 1) &#039; Generate random value between 1 and 6<BR><BR>Response.Write "<BR>The Amplify random number is " & randomamp<BR>Response.Write "<BR>The Visualize 1 random number is " & randomvis1<BR>Response.Write "<BR>The Visualize 2 random number is " & randomvis2<BR><BR>How can I make sure that randomvis1 and randomvis2 never end up being the same number?<BR><BR>Is there a clever way to check for this without a big nasty loop thingy?<BR><BR>Thanks!

2. Senior Member
Join Date
Dec 1969
Location
Los Angeles, CA
Posts
21,192

## RE: Fun with Random numbers

maybe something like this after that piece of code.<BR>while randomvis2 = randomvis1 <BR>randomvis2 = Int((6 * Rnd) + 1)<BR>wend<BR><BR><BR>

3. Kentium Guest

## nice! Thanks! (eom)

x

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•