开发工具:
文件大小: 2kb
下载次数: 0
上传时间: 2011-03-10
详细说明: 石头剪刀布的源代码我也是新手,随便做个玩玩。把RadioButton0,1,2放一个容器里! Public Class Form1 Dim win1 As Integer = 0 Dim win2 As Integer = 0 Dim i As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim str As Integer Dim rand As New Random() str =rand.Next(3)'随机数 If str = 0 Then RadioButton0.Checked = True ElseIf str = 1 Then RadioButton1.Checked = True ElseIf str = 2 Then RadioButton2.Chec ked = True End If If RadioButton3.Checked = True Then i = 0 ElseIf RadioButton4.Checked = True Then i = 1 ElseIf RadioButton5.Checked = True Then i = 2 Else MsgBox("请选择要出的拳法!") End If If (str = 0 And i = 1) Or (str = 1 And i = 2) Or (str = 2 And i = 0) Then win1 += 1 TextBox1.Text = "玩家胜利" ElseIf (str = 0 And i = 2) Or (str = 1 And i = 0) Or (str = 2 And i = 1) Then win2 += 1 TextBox1.Text = "电脑胜利" Else TextBox1.Text = "平手" End If'判断胜利者 TextBox2.Text = win1 TextBox3.Text = win2 If win1 = 5 Then MsgBox("最终胜利者是玩家!恭喜!") win1 = 0 win2 = 0 For i = 0 To Me.Controls.Count - 1 If TypeOf (Me.Controls(i)) Is TextBox Then Me.Controls(i).Text = "" End If'清空过时信息 Next ElseIf win2 = 5 Then MsgBox("最终胜利者是电脑!") win1 = 0 win2 = 0 For i = 0 To Me.Controls.Count - 1 If TypeOf (Me.Controls(i)) Is TextBox Then Me.Controls(i).Text = "" End If'清空过时信息 Next End If End Sub End Class ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.