
password(1) could be "secret1"
while password(2) coud be "secret100"
the way you check would give a false positive!

you gotta change one line to:
Code: Select all
If gekozenpasswords(n) = gekozenpasswords(m)
Code: Select all
If gekozenpasswords(n) = gekozenpasswords(m)
Code: Select all
OpenConsole( )
Ok = 1
i = 1
min_min = 0
max_max = 1000
Repeat
password_n = 500
user_n = 200
max = 0
min = 1000
Dim passwords(password_n)
Dim gekozenpasswords(user_n)
For n = 1 To password_n
passwords(n) = n
Next n
For n = 1 To user_n
r = Random(password_n-1)+1
gekozenpasswords(n) = passwords(r)
passwords(r) = passwords(password_n)
password_n = password_n-1
Next n
For n = 1 To user_n
If gekozenpasswords(n) > max
max = gekozenpasswords(n)
endif
If gekozenpasswords(n) < min
min = gekozenpasswords(n)
EndIf
Next n
If min_min < min
min_min = min
EndIf
If max_max > max
max_max = max
EndIf
PrintN( "i = " + Str( i ) + " max_max " + Str( max_max ) + " min_min " + Str( min_min ) )
i = i + 1
Until ok = 0
CloseConsole( )
Code: Select all
RandomSeed(gettickcount_())
Code: Select all
RandomSeed(Value)
I keep my posts short..Codemonger wrote:Sorry LarsG, didn't catch your post(randomseed)
i would too if my ego wouldn't need so much space...LarsG wrote:I keep my posts short..Codemonger wrote:Sorry LarsG, didn't catch your post(randomseed)