📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "石头、剪刀、布"
ClientHeight = 4710
ClientLeft = 60
ClientTop = 345
ClientWidth = 6300
LinkTopic = "Form1"
ScaleHeight = 4710
ScaleWidth = 6300
StartUpPosition = 3 'Windows Default
Begin VB.Frame Frame1
Caption = "结果"
Height = 855
Left = 1200
TabIndex = 9
Top = 3600
Width = 2895
Begin VB.Label Label13
Height = 255
Left = 2040
TabIndex = 13
Top = 360
Width = 735
End
Begin VB.Label Label12
Height = 255
Left = 720
TabIndex = 12
Top = 360
Width = 615
End
Begin VB.Label Label11
Caption = "电脑:"
Height = 255
Left = 1440
TabIndex = 11
Top = 360
Width = 495
End
Begin VB.Label Label10
Caption = "人:"
Height = 255
Left = 240
TabIndex = 10
Top = 360
Width = 375
End
End
Begin VB.Label Label9
Caption = "电脑:"
Height = 375
Left = 2760
TabIndex = 8
Top = 2400
Width = 495
End
Begin VB.Label Label8
Caption = "人:"
Height = 375
Left = 720
TabIndex = 7
Top = 2400
Width = 495
End
Begin VB.Label Label7
Caption = "评判:"
Height = 255
Left = 960
TabIndex = 6
Top = 3120
Width = 615
End
Begin VB.Label Label6
Caption = "石头 剪刀 布"
Height = 375
Left = 1800
TabIndex = 5
Top = 1080
Width = 2535
End
Begin VB.Label Label5
Caption = "请点击右边的图标进行选择"
Height = 495
Left = 120
TabIndex = 4
Top = 1200
Width = 1095
End
Begin VB.Label Label4
Height = 495
Left = 3600
TabIndex = 3
Top = 2400
Width = 975
End
Begin VB.Label Label3
Height = 495
Left = 1560
TabIndex = 2
Top = 2280
Width = 855
End
Begin VB.Label Label2
Height = 255
Left = 1920
TabIndex = 1
Top = 3120
Width = 2415
End
Begin VB.Label Label1
Caption = "石头、剪刀、布"
BeginProperty Font
Name = "华文行楷"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1440
TabIndex = 0
Top = 240
Width = 2895
End
Begin VB.Image Image3
Height = 510
Left = 3720
Picture = "Form1.frx":0000
Top = 1440
Width = 510
End
Begin VB.Image Image2
Height = 510
Left = 2760
Picture = "Form1.frx":0E12
Top = 1440
Width = 510
End
Begin VB.Image Image1
Height = 510
Left = 1680
Picture = "Form1.frx":171C
Top = 1440
Width = 510
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim a, b, cs, ps As Integer
Private Sub Form_Load()
Randomize
ps = 0
cs = 0
Label12.Caption = ps & "分"
Label13.Caption = cs & "分"
End Sub
Sub cq()
a = Int(3 * Rnd)
If a = 0 Then
Label4.Caption = "石头"
End If
If a = 1 Then
Label4.Caption = "剪刀"
End If
If a = 2 Then
Label4.Caption = "布"
End If
If a = b Then
Label2.Caption = "平局"
End If
If a - b = 1 Or a - b = -2 Then
Label2.Caption = "你赢了!"
ps = ps + 1
Label12.Caption = ps & "分"
End If
If a - b = -1 Or a - b = 2 Then
Label2.Caption = "你输了!"
cs = cs + 1
Label13.Caption = cs & "分"
End If
Label2.Visible = True
End Sub
Private Sub Image1_Click()
Label3.Caption = "石头"
b = 0
cq
End Sub
Private Sub Image2_Click()
Label3.Caption = "剪刀"
b = 1
cq
End Sub
Private Sub Image3_Click()
Label3.Caption = "布"
b = 2
cq
End Sub
Private Sub Image4_Click()
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -