求帮助vb急

来源:百度知道 编辑:UC知道 时间:2024/05/19 15:29:30
现在我编码都写好了,这是剪刀石头布的编码,我希望有一个计时器,计时器结束就会说谁赢的比较多,时间是两分半,请帮忙继续写下去,谢谢
如果有什麼不好地方可以交我如何更改
Dim computewintimes As Integer
Dim playerwintimes As Integer

Private Sub Command3_Click()

Randomize
conAction = Int(Rnd * 3) + 1

If conAction = 1 Then
Label4.Caption = "Tie"
Label7.Caption = "Rock"
Label8.Caption = "Tie"
Label5.Caption = "Tie"
Label10.Caption = "Rock"
End If
If conAction = 2 Then
Label4.Caption = "Computer"
Label7.Caption = "Paper"
Label5.Caption = "Win"
Label8.Caption = "Lose"
Label10.Caption = "Rock"
End If
If conAction = 3 Then
Label7.Caption = "Scissors"
Label10.Caption = "Rock"
Label5.Caption = "Lose"
Label8.Caption = "Win"
Label4.Caption = "Player"
End If
If Label4.Caption = &qu

这是我写的,参考下吧
Dim win%, loss%, Time%
Private Sub Command1_Click()
Dim Com As Integer, i%
Com = Val(Rnd * 3)
For i = 0 To 2
If Option1(i).Value = True Then
Exit For
End If
Next i
Select Case i
Case 0:
If Com = 2 Then win = win + 1
If Com = 1 Then loss = loss + 1
Case 1:
If Com = 0 Then win = win + 1
If Com = 2 Then loss = loss + 1
Case 2:
If Com = 1 Then win = win + 1
If Com = 2 Then loss = loss + 1
End Select
Label1(0).Caption = "Win:" & win & "盘"
Label1(1).Caption = "Loss:" & loss & "盘"
End Sub

Private Sub Command2_Click()
On Error GoTo errhandle
Time = Int(InputBox("请输入比赛时间,以秒为单位", "计时", 5))
Timer1.Enabled = True