資源簡介
一款撲克游戲,系統自動生成5張牌,游戲開始后用戶有一次換牌的機會,如果所換新牌符合系統預置的條件規定,則系統會為用戶加分,以示獎勵,否則要倒扣分!

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Text;
using?System.Windows.Forms;
//====================================================
//
//??????????http://www.VSBox.CN
//
//??????????????【VS盒子】
//
//??????希望這個源碼能幫到您??:)
//??????
//
//=====================================================
namespace?金撲克
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????bool?IsRepeat(string[]?ir)
????????{
????????????for?(int?i?=?0;?i?????????????{
????????????????for?(int?j?=?i?+?1;?j?????????????????{
????????????????????if?(i?==?j)?continue;
????????????????????if?(ir[i]?==?ir[j])?return?false;
????????????????}
????????????}
????????????return?true;
????????}
????????void?evaluate()
????????{
????????????ptb1.ImageLocation?=?path?+?pic1?+?extend;
????????????ptb2.ImageLocation?=?path?+?pic2?+?extend;
????????????ptb3.ImageLocation?=?path?+?pic3?+?extend;
????????????ptb4.ImageLocation?=?path?+?pic4?+?extend;
????????????ptb5.ImageLocation?=?path?+?pic5?+?extend;
????????}
????????
????????void?rand()
????????{
????????????int?s?=?unchecked((int)DateTime.Now.Ticks);
????????????string[]?temp?=?new?string[5];
????????????string[]?pics?=?new?string[5];
????????????//生成第1張隨機
????????????if?(ptb1.ImageLocation?==?path?+?“bg“?+?extend)
????????????{
????????????????Ti?+=?1050;
????????????????pics[0]?=?pic1;
????????????????Random?ra?=?new?Random(++Ti?+?(++s));
????????????????pic1?=?ra.Next(1?5).ToString();
????????????????
????????????????while?(true)
????????????????{
????????????????start:
????????????????????;
????????????????????Ti?+=?3;
????????????????????ra?=?new?Random(++Ti?+?(++s));
????????????????????temps[0]?=?ra.Next(1?14).ToString();
????????????????????switch?(temps[0])
????????????????????{
????????????????????????case?“10“:?temp[0]?=?“t“;?break;
????????????????????????case?“11“:?temp[0]?=?“j“;?break;
????????????????????????case?“12“:?temp[0]?=?“q“;?break;
????????????????????????case?“13“:?temp[0]?=?“k“;?break;
????????????????????????default:?temp[0]?=?temps[0];?break;
????????????????????}
????????????????????pic1?=?pic1[0].ToString()?+?temp[0];
????????????????????if?(temps[0]?==?temps[1])
????????????????????{
????????????????????????if?(pic1?==?pic2)
????????????????????????{
????????????????????????????goto?start;
????????????????????????}
????????????????????}
????????????????????if?(temps[0]?==?temps[2])
????????????????????{
????????????????????????if?(pic1?==?pic3)
????????????????????????{
????????????????????????????goto?start;
????????????????????????}
????????????????????}
????????????????????if?(temps[0]?==?temps[3])
????????????????????{
????????????????????????if?(pic1?==?pic4)
????????????????????????{
?????????????????????????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
-----------?---------??----------?-----??----
??????????????7737310????????????????????139
- 上一篇:Asp.net 酒店管理系統
- 下一篇:C#版二代身份證讀卡器閱讀程序
評論
共有 條評論