I have a function that generates a random 6-Digit Number, so there should be at least 6^10 possible combinations. However I ran the function 1000 times and I got the same numbers 3 or 4 times. Here is my code:
VB Code:
<%
Function RandomPW()
For X = 1 To 6
Randomize
strPW = strPW & CHR(Int((9 * Rnd) + 48))
Next
RandomPW = strPW
End Function
for i = 0 to 1000
response.write RandomPW() & "<br>"
next
%>
After I got the result, I put it into Excel and sorted it. Attached is the list that I was returned, after I sorted it in Excel.
Am I doing something wrong as far as generating random numbers?
thanks,
Dimava
NXSupport - Your one-stop source for computer help