按鈕三
Dim a(6), b(6) As Integer
Dim i, n, temp As Integer
Dim prize
a(1) = Text1.Text
a(2) = Text2.Text
a(3) = Text3.Text
a(4) = Text4.Text
a(5) = Text5.Text
a(6) = Text6.Text
b(1) = Text7.Text
b(2) = Text8.Text
b(3) = Text9.Text
b(4) = Text10.Text
b(5) = Text11.Text
b(6) = Text12.Text
prize = 0
Do While i <= 6 '當i<6的時候要做 因為有六個數字要比較
temp = a(i)
n = b(i) 'n是由陣列b產生的數字 會變動
For i = 1 To 6
If temp = n Then
prize = prize + 1
End If
Next
i += 1
Loop
Do While i <= 6 '當i<6的時候要做 因為有六個數字要比較
n = Int(Rnd() * 48) + 1
b(i) = n 'n是由陣列b產生的數字 會變動
For c = 1 To i - 1
If c < i And n = b(c) Then
i = i - 1
End If
Next
i += 1
Loop
Text1.Text = b(1)
Text2.Text = b(2)
Text3.Text = b(3)
Text4.Text = b(4)
Text5.Text = b(5)
Text6.Text = b(6)