Dim A(4), G(4), k, sa
Private Sub Command1_Click()
If Text1 = "" Then MsgBox ("Lütfen Bir sayın Girin"): Text1.SetFocus: Exit Sub
If Len(Text1) > 4 Or Len(Text1) < 4 Then MsgBox ("Sayı 4 Basamaklı Olmak Zorunda"): Text1 = "": Text1.SetFocus: Exit Sub
sa = sa + 1
hh = Mid(Str(Val(Text1)), 2, 4)
For s = 1 To 4
G(s) = Mid(hh, s, 1)
Next s
For m = 1 To 4
For j = 1 To 4
If A(m) = G(j) And m = j Then d = d + 1
If A(m) = G(j) And m <> j Then y = y + 1
Next j
Next m
sonuc = "+" + Str(d) + " -" + Str(y)
List1.AddItem Str(sa)
List2.AddItem hh
List3.AddItem sonuc
If d = 4 Then
Label10.Caption = sa
Frame1.Visible = True
Label1.Caption = A(1)
Label2.Caption = A(2)
Label3.Caption = A(3)
Label4.Caption = A(4)
c = MsgBox("Tekrar Oynamak İstermisiniz", vbYesNo + vbQuestion, "ÇIKIŞ")
If c = 6 Then
k = 0:
sa = 0:
Frame1.Visible = False
Label1.Caption = "X"
Label2.Caption = "X"
Label3.Caption = "X"
Label4.Caption = "X"
List1.Clear: List2.Clear: List3.Clear
Text1 = "": Text1.SetFocus
Timer1.Enabled = True: Exit Sub
End If
If c = 7 Then End
End If
Text1 = "": Text1.SetFocus
End Sub
Private Sub Command2_Click()
Timer1.Enabled = False
For hh = 1 To 3
For jj = hh + 1 To 4
If A(hh) = A(jj) Then
k = 0
Timer1.Enabled = True
Exit Sub
End If
Next jj: Next hh
If A(1) = "0" Then k = 0: Timer1.Enabled = True
End Sub
Private Sub Form_Load()
Show
End Sub
Private Sub Timer1_Timer()
basla:
k = k + 1:
Randomize Timer
A(k) = Mid(Str(Int(Rnd * 10)), 2, 1)
If k = 4 Then Command2_Click
End Sub