Private Sub command1_Click()
Dim a(9) As Integer, i As Integer, d(4) As Integer
Do While d(i) <> 6
For i = 1 To 9
a(i) = Fix(Rnd * 3) + 1
Next i
For i = 1 To 3
d(i) = a(3 * i - 2) + a(3 * i - 1) + a(3 * i)
If d(i) = 6 Then Exit For
Next i
Loop
Print d(i)
End Sub
Dim a(9) As Integer, i As Integer, d(3) As Integer
Do while d(i)<>6
For i = 1 To 9
a(i) = Fix(Rnd * 3) + 1
Next i
For i = 1 To 3
d(i) = a(3*i-2)+a(3*i-1)+a(3*i)
Next i
loop