im trying to pick not duplicated 29 random number in range 0-80. For this i define a function to pick a random number in definable range.
Code:
Function RandomSayi(ByVal enküçük As Integer, ByVal enbüyük As Integer) As Integer
RandomSayi = Int((enbüyük - enküçük + 1) * Rnd + enküçük)
End Function
after that i define global 2 arrays which range is 29 named Geçici(28) and Kalıcı(28)
Code:
Dim Kalıcı(28), Geçici(28) as integer
and than i wanted a public Sub for Creating a Kalıcı(28) array whose members are random and not duplicated integers
Code:
Public Sub RandomIndis()
Dim i, k As Integer
Geçici(0) = RandomSayi(0, 80)
Kalıcı(0) = Geçici(0)
i = 1
While (i < 28)
Geçici(i) = RandomSayi(0, 80)
For k = 0 To i - 1 Step 1
If (Geçici(i) <> Geçici(k)) Then
Next k
Kalıcı(i) = Geçici(i)
lbIndis.AddItem (Str(Kalıcı(i)))
i = i + 1
End If
Wend
in this algorythm i want to pick the Geçici(i) and check ifnot there is any duplicated members in same array . and if it cant find any duplicates it will be my Kalıcı(i) array's i. member ; To do this i need to put
next k code
the exact place that already it placed..