資源簡介
C#語言寫的Windows Form式猜拳游戲軟件
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Threading.Tasks;
using?System.Windows.Forms;
using?System.xml;
namespace?cq
{
????public?partial?class?Form1?:?Form
????{
????????Image[]?wUser?=?{?Resource1.wA?Resource1.wB?Resource1.wC?Resource1.wD?};
????????Image[]?jqUser?=?{?Resource1.jqA?Resource1.jqB?Resource1.jqC?Resource1.jqD?};
????????Image[]?jqCq?=?{?Resource1.jqst?Resource1.jqjd?Resource1.jqbu?};
????????int?wdx?=?0;//我的圖片的Tag
????????int?jqdx?=?0;//機器人圖片的Tag
????????int?wsNo?=?0;//我勝的場數
????????int?zcsNo?=?0;//總的場數
????????int?pjNo?=?0;//平局的場數
????????int?jqrsNO?=?0;//機器人勝的場數
????????int?i=0;//當前xml文檔中存有幾條記錄
????????xmlDocument?xmlDoc;
????????//public?int?jqrNd?{?get;?set;?}
????????int?jqrNd=0;//當前的游戲難度
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????????zcs_txt.Text?=?“0“;
????????????ws_txt.Text?=?“0“;
????????????jqrs_txt.Text?=?“0“;
????????????pj_txt.Text?=?“0“;
????????????w_pct.Image?=?wUser[3];
????????????jq_pct.Image=jqUser[0];???????
????????}
????????private?void?w_pct_Click(object?sender?EventArgs?e)//點擊我的圖片觸發事件
????????{
????????????w_pct.Image?=?wUser[getRand(4)];
????????}
????????private?void?jq_pct_Click(object?sender?EventArgs?e)//點擊機器人圖片觸發事件
????????{
????????????jq_pct.Image?=?jqUser[getRand(4)];
????????}
????????private?void?wcq_Click(object?sender?EventArgs?e)//點擊石頭剪刀布觸發事件
????????{
????????????jqrNd?=?Form_選項.rdNo;
????????????//MessageBox.Show(“難度“+jqrNd.ToString());
????????????wcq_pct.Image=(sender?as?PictureBox).Image;
????????????wdx?=?int.Parse((sender?as?PictureBox).Tag.ToString());
????????????jqdx?=?getRand(3);
????????????jqcq_pct.Image?=?jqCq[jqdx];
????????????//MessageBox.Show(wdx.ToString()+jqdx.ToString());
????????????zcsNo?=?int.Parse(zcs_txt.Text);
????????????zcsNo?+=?1;
????????????zcs_txt.Text?=?zcsNo.ToString();
????????????//pk();
????????????ndHs();
????????????
????????}
????????private?int?getRand(int?seed)//隨機函數
????????{
????????????Random?rand?=?new?Random();
????????????return?rand.Next(seed);
????????}
????????private?void?pk()
????????{
????????????if?(wdx?==?jqdx)
????????????{
????????????????pingju();?//平局????????
????????????}
????????????else?if?(wdx?==?0?&&?jqdx?==?1?||?wdx?==?1?&&?jqdx?==?2?||?wdx?==?2?&&?jqdx?==?0)
????????????{
????????????????wying();//我贏
????????????}
????????????else
????????????{
????????????????jqying();//機器人贏
????????????}
????????}
????????private?void?pingju()
????????{
????????????//MessageBox.Show(“平局!“);
????????????pjNo?=?int.Parse(pj_txt.Text);
????????????pjNo?+=?1;
????????????pj_txt.Text?=?pjNo.ToString();
????????????pj_pct.Left?=?316;
????????}
????????private?void?wying()
????????{
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????12288??2015-03-16?19:40??cq\2012442095田園Net高級技術第二次作業.doc
?????文件????????187??2015-03-16?14:13??cq\cq\App.config
?????文件???????1457??2015-03-25?17:08??cq\cq\bin\Debug\acc.xm
?????文件????????381??2015-03-24?18:46??cq\cq\bin\Debug\acc.xm
?????文件????1011712??2015-03-25?17:08??cq\cq\bin\Debug\cq.exe
?????文件????????187??2015-03-16?14:13??cq\cq\bin\Debug\cq.exe.config
?????文件??????75264??2015-03-25?17:08??cq\cq\bin\Debug\cq.pdb
?????文件??????11592??2015-03-25?23:12??cq\cq\bin\Debug\cq.vshost.exe
?????文件????????187??2015-03-16?14:13??cq\cq\bin\Debug\cq.vshost.exe.config
?????文件????????490??2014-01-23?03:27??cq\cq\bin\Debug\cq.vshost.exe.manifest
?????文件???????7553??2015-03-25?17:08??cq\cq\cq.csproj
?????文件???????9796??2015-03-25?15:54??cq\cq\Form1.cs
?????文件??????19578??2015-03-25?15:54??cq\cq\Form1.Designer.cs
?????文件???????6188??2015-03-25?15:54??cq\cq\Form1.resx
?????文件???????3429??2015-03-25?15:45??cq\cq\Form_統計.cs
?????文件???????7931??2015-03-25?15:45??cq\cq\Form_統計.Designer.cs
?????文件???????5817??2015-03-25?15:45??cq\cq\Form_統計.resx
?????文件????????395??2015-03-25?15:46??cq\cq\Form_規則.cs
?????文件???????3341??2015-03-25?15:46??cq\cq\Form_規則.Designer.cs
?????文件???????5817??2015-03-25?15:46??cq\cq\Form_規則.resx
?????文件???????1852??2015-03-25?15:45??cq\cq\Form_記錄.cs
?????文件???????5260??2015-03-25?15:45??cq\cq\Form_記錄.Designer.cs
?????文件???????5817??2015-03-25?15:45??cq\cq\Form_記錄.resx
?????文件????????981??2015-03-25?15:46??cq\cq\Form_選項.cs
?????文件???????5567??2015-03-25?15:46??cq\cq\Form_選項.Designer.cs
?????文件???????5817??2015-03-25?15:46??cq\cq\Form_選項.resx
?????文件????????627??2015-03-25?23:12??cq\cq\obj\Debug\cq.csproj.FileListAbsolute.txt
?????文件????????902??2015-03-25?17:08??cq\cq\obj\Debug\cq.csproj.GenerateResource.Cache
?????文件???????2211??2015-03-18?23:21??cq\cq\obj\Debug\cq.csprojResolveAssemblyReference.cache
?????文件????1011712??2015-03-25?17:08??cq\cq\obj\Debug\cq.exe
............此處省略90個文件信息
評論
共有 條評論