VB Visual Basic Script ile rastgele sayı üretmek VBS Script

Sub SayisalLoto(sayiaraligi,kactane)
‘ Developer Burhan KARADERE

Dim tuzaksayisi(10)
Dim sayi, j
Dim buldu

sayi = 0
j = 0

‘ tumu oalcak ise
if sayiaraligi = kactane then

For j = 0 To kactane – 1
tuzaksayisi(j) = j + 1
Wscript.echo tuzaksayisi(j)
Next

else

buldu = False

For i = 0 To kactane

buldu = False

Do While buldu = False

sayi = Int((sayiaraligi * Rnd + 1) )

For j = 0 To kactane
If tuzaksayisi(j) = sayi Then
Exit For

End If
Next

If j = kactane + 1 Then
tuzaksayisi(i) = sayi
buldu = True
End If
Loop
Next

For i = 1 To kactane

Wscript.echo tuzaksayisi(i)

Next
end if
End Sub
Call SayisalLoto(10,6)

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)