资源简介
一个基于C#编写的剪刀石头布的小游戏,适合于教学用,适合于初学者学习用

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace SX4_3
{
public partial class MainForm : Form
{
int intMyScore;//我赢的局数
int intComputerScore;//电脑赢的局数
bool blReady; //开始按钮的状态
int intMySelect; //我每次的选择
int intComputerSelect; //电脑每次的选择
int intTotal; //总局数
public MainForm()
{
InitializeComponent();
}
private void MainForm_Load(object sender EventArgs e)
{
blReady = true;
if (blReady)
{
this.btnComputer1.Visible = false;
this.btnComputer2.Visible = false;
this.btnComputer3.Visible = false;
this.btnMy1.Visible = false;
this.btnMy2.Visible = false;
this.btnMy3.Visible = false;
this.lblResult.Visible = false;
intMyScore = 0;
intComputerScore = 0;
this.lblComputer.Text = (intTotal).ToString() + “局“ + intComputerScore.ToString() + “胜“;
this.lblMy.Text = (intTotal).ToString() + “局“ + intMyScore.ToString() + “胜“;
this.btnStart.Text = “开始“;
intMySelect=-1;
intComputerSelect=-1;
intTotal=0;
}
}
private void btnStart_Click(object sender EventArgs e)
{
if (blReady)
{
this.btnStart.Text = “再来一次“;
this.btnMy1.Visible = true;
this.btnMy2.Visible = true;
this.btnMy3.Visible = true;
this.lblResult.Visible = false;
blReady = false;
}
else
{
this.btnComputer1.Visible = false;
this.btnComputer2.Visible = false;
this.btnComputer3.Visible = false;
this.btnMy1.Visible = false;
this.btnMy2.Visible = false;
this.btnMy3.Visible = false;
this.lblResult.Visible = false;
this.lblComputer.Text = (intMyScore + intComputerScore).ToString() + “局“ + intComputerScore.ToString() + “胜“;
this.lblComputer.Text = (intMyScore + intComputerScore).ToString() + “局“ + intMyScore.ToString() + “胜“;
this.btnStart.Text = “开始“;
blReady = true;
}
}
private void btnMy1_Click(object sender EventArgs e)
{
intMySelect = 1;
btnMy2.Visible = false;
btnMy3.Visible = false;
btnComputer1.Visible = true;
btnComputer2.Visible = true;
btnComputer3.Visible = true;
ComputerAutoSelect();
}
private void btnMy2_Click(object sender E
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-08-30 19:28 SX4-3\
目录 0 2012-08-30 19:28 SX4-3\bin\
目录 0 2012-08-30 19:28 SX4-3\bin\Debug\
文件 208896 2010-05-11 15:58 SX4-3\bin\Debug\SX4-3.exe
文件 28160 2010-05-11 15:58 SX4-3\bin\Debug\SX4-3.pdb
文件 11608 2011-10-13 07:58 SX4-3\bin\Debug\SX4-3.vshost.exe
文件 490 2010-03-17 22:39 SX4-3\bin\Debug\SX4-3.vshost.exe.manifest
目录 0 2011-09-29 10:07 SX4-3\bin\Release\
文件 6816 2010-05-11 15:58 SX4-3\MainForm.cs
文件 12423 2010-04-19 15:19 SX4-3\MainForm.Designer.cs
文件 281228 2009-09-19 19:14 SX4-3\MainForm.resx
目录 0 2012-08-30 19:28 SX4-3\obj\
目录 0 2012-08-30 19:28 SX4-3\obj\Debug\
文件 5481 2011-09-29 10:07 SX4-3\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
目录 0 2011-06-16 06:43 SX4-3\obj\Debug\Refactor\
文件 242 2011-10-13 07:58 SX4-3\obj\Debug\SX4-3.csproj.FileListAbsolute.txt
文件 845 2010-04-19 15:15 SX4-3\obj\Debug\SX4-3.csproj.GenerateResource.Cache
文件 208896 2010-05-11 15:58 SX4-3\obj\Debug\SX4-3.exe
文件 28160 2010-05-11 15:58 SX4-3\obj\Debug\SX4-3.pdb
文件 184320 2010-04-19 15:17 SX4-3\obj\Debug\SX4_3.MainForm.resources
文件 180 2010-04-19 15:15 SX4-3\obj\Debug\SX4_3.Properties.Resources.resources
目录 0 2012-08-30 19:28 SX4-3\obj\Debug\TempPE\
文件 4608 2011-09-29 10:07 SX4-3\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll
文件 971 2010-10-25 08:02 SX4-3\obj\SX4-3.csproj.FileListAbsolute.txt
文件 467 2010-04-19 15:17 SX4-3\Program.cs
目录 0 2012-08-30 19:28 SX4-3\Properties\
文件 1174 2010-04-19 15:12 SX4-3\Properties\AssemblyInfo.cs
文件 2848 2011-09-29 10:07 SX4-3\Properties\Resources.Designer.cs
文件 5612 2010-04-19 15:12 SX4-3\Properties\Resources.resx
文件 1103 2011-09-29 10:07 SX4-3\Properties\Settings.Designer.cs
文件 249 2010-04-19 15:12 SX4-3\Properties\Settings.settings
............此处省略2个文件信息
- 上一篇:操作系统进程管理系统课程设计C#
- 下一篇:c# chart控件实时显示曲线
相关资源
- C# OCR数字识别实例,采用TessnetOcr,对
- 考试管理系统 - C#源码
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
- 基于c#的实验室设备管理系统621530
评论
共有 条评论