Sayısal Loto — Visual Basic 6
[code lang=”vb”]
Private Sub Command1_Click()
List1.Clear
Dim dizi(6) As Integer
Dim sayi, j As Integer
Dim buldu As Boolean
sayi = 0
j = 0
buldu = False
For i = 0 To 5
buldu = False
Do While buldu = False
sayi = Int((49 * Rnd) + 1)
For j = 0 To 5
If dizi(j) = sayi Then
Exit For
End If
Next
If j = 6 Then
dizi(i) = sayi
buldu = True
End If
Loop
Next
For i = 0 To 5
List1.AddItem (dizi(i))
Next i
End Sub
[/code]

