[Open]
[Close]
電腦問題(錯區。。求版主幫手轉區)
Dim num_1, num_2, num_3 As Integer
Dim total As Integer
Dim bingo As Integer
Private Sub form_load()
total = 0
bingo = 0
End Sub
Private Sub PRESS_BTM_Click()
Randomize
total = total + 1
num_1 = Int(Rnd * 6) + 1
num_2 = Int(Rnd * 6) + 1
num_3 = Int(Rnd * 6) + 1
If num_1 = 1 Then Image1.Picture = Image_pic1.Picture
If num_1 = 2 Then Image1.Picture = Image_pic2.Picture
If num_1 = 3 Then Image1.Picture = Image_pic3.Picture
If num_1 = 4 Then Image1.Picture = Image_pic4.Picture
If num_1 = 5 Then Image1.Picture = Image_pic5.Picture
If num_1 = 6 Then Image1.Picture = Image_pic6.Picture
If num_2 = 1 Then Image2.Picture = Image_pic1.Picture
If num_2 = 2 Then Image2.Picture = Image_pic2.Picture
If num_2 = 3 Then Image2.Picture = Image_pic3.Picture
If num_2 = 4 Then Image2.Picture = Image_pic4.Picture
If num_2 = 5 Then Image2.Picture = Image_pic5.Picture
If num_2 = 6 Then Image2.Picture = Image_pic6.Picture
If num_3 = 1 Then Image3.Picture = Image_pic1.Picture
If num_3 = 2 Then Image3.Picture = Image_pic2.Picture
If num_3 = 3 Then Image3.Picture = Image_pic3.Picture
If num_3 = 4 Then Image3.Picture = Image_pic4.Picture
If num_3 = 5 Then Image3.Picture = Image_pic5.Picture
If num_3 = 6 Then Image3.Picture = Image_pic6.Picture
If (num_1 = num_2) And (num_1 = num_3) Then
bingo = bingo + 1
MsgBox "bingo!you are winning " & bingo & " out of " & total & "times", , "winning"
End If
End Sub
[ 本帖最後由 梁一鳴 於 2010-5-19 20:40 編輯 ]