参加请到: http://topic.csdn.net/u/20080421/17/6a4d1c20-e1d1-4e9d-99ae-d648cb422ca6.html
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using System;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using System.Collections.Generic;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using System.Text;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
namespace Huaquan
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
... {
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**////<summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///划拳结果
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
///</summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
publicenumResult
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**////<summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///未知,还没开始判断
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
///</summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Unknown,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**////<summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///平局,结果一致
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
///</summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dogfall,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**////<summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///胜,猜中结果
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
///</summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Win,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**////<summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///负,对方猜中结果,自己没有猜中
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
///</summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Lost,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**////<summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///犯规,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
///</summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Foul,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**////<summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///超时,反应时间超出100毫秒
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
///</summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Overtime
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**////<summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///酒鬼类
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
///</summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
publicabstractclassDrunkard
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**////<summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///出拳
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///</summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///<paramname="ANumber">出的手指数</param>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
///<paramname="ASum">猜的合计</param>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
abstractpublicvoidCome(outintAFinger,outintASum);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**////<summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///接收结果
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///</summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///<paramname="AOtherFinger">对方出的手指数</param>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///<paramname="AOtherSum">对方猜的合计</param>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///<paramname="AOtherResult">对方划拳的结果</param>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///<paramname="ASelfFinger">自己出的手指数</param>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///<paramname="ASelfSum">自己猜的合计</param>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
///<paramname="ASelfResult">自己划拳的结果</param>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
abstractpublicvoidOutcome(intAOtherFinger,intAOtherSum,ResultAOtherResult,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
intASelfFinger,intASelfSum,ResultASelfResult);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
publicclassZswang一号:Drunkard
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
publicoverridevoidCome(outintAFinger,outintASum)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
AFinger=5;//每次都出5
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
ASum=10;//每次都猜10
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
publicoverridevoidOutcome(intAOtherFinger,intAOtherSum,ResultAOtherResult,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
intASelfFinger,intASelfSum,ResultASelfResult)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**//*这机器人不关心比赛结果*/
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
publicclassZswang二号:Drunkard
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
privateRandomrandom;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
publicZswang二号()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
random=newRandom();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
publicoverridevoidCome(outintAFinger,outintASum)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
ASum=random.Next(10+1);//0-10
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(ASum<5)//别犯规
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
AFinger=random.Next(ASum+1);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
elseAFinger=random.Next(ASum-5,5+1);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
publicoverridevoidOutcome(intAOtherFinger,intAOtherSum,ResultAOtherResult,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
intASelfFinger,intASelfSum,ResultASelfResult)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**//*这机器人也不关心比赛结果*/
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**////<summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///酒馆类
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///</summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///<typeparamname="T1">划拳机器人1</typeparam>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
///<typeparamname="T2">划拳机器人2</typeparam>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
publicclassDrunkery<T1,T2>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
whereT1:Drunkard,new()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
whereT2:Drunkard,new()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**////<summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///东家
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
///</summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
privateDrunkardeastPlayer;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**////<summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///西家
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
///</summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
privateDrunkardwestPlayer;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**////<summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///东家积分
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
///</summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
privateinteastTotal;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**////<summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///西家积分
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
///</summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
privateintwestTotal;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**////<summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///东家超时次数
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
///</summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
privateinteastOvertime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**////<summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///西家超时次数
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
///</summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
privateintwestOvertime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**////<summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///划拳次数
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
///</summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
publicconstintcomeCount=1000;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**////<summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///超时罚分
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
///</summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
publicconstintovertimePenalty=1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**////<summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///异常罚分
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
///</summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
publicconstintcatchPenalty=100;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
/**////<summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
///开始比赛
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
///</summary>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
publicvoidPlay()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
初始化#region初始化
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
longvEastTick=Environment.TickCount;//东家初始化的时间
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
eastPlayer=newT1();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vEastTick=Environment.TickCount-vEastTick;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
longvWestTick=Environment.TickCount;//西家初始化的时间
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
westPlayer=newT2();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vWestTick=Environment.TickCount-vWestTick;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
eastTotal=0;westTotal=0;eastOvertime=0;westOvertime=0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
超时处理#region超时处理
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vEastTick>1000||vWestTick>1000)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vEastTick>1000)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Console.WriteLine("{0}初始化严重超时",typeof(T1).Name);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vWestTick>1000)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Console.WriteLine("{0}初始化严重超时",typeof(T2).Name);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vEastTick>100)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
eastTotal-=overtimePenalty;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
eastOvertime++;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vWestTick>100)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
westTotal-=overtimePenalty;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
westOvertime++;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
#endregion超时处理
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
#endregion初始化
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
猜拳过程#region猜拳过程
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
for(inti=0;i<comeCount;i++)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
for(intj=0;j<100;j++)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
intvEastFinger=0,vWestFinger=0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
intvEastSum=0,vWestSum=0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
ResultvEastResult=Result.Unknown;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
ResultvWestResult=Result.Unknown;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
出拳#region出拳
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
boolvEastCatch=false;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vEastTick=Environment.TickCount;//东家出拳的时间
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
try
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
eastPlayer.Come(outvEastFinger,outvEastSum);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
catch//出现异常
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vEastCatch=true;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vEastTick=Environment.TickCount-vEastTick;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
boolvWestCatch=false;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vWestTick=Environment.TickCount;//西家出拳的时间
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
try
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
westPlayer.Come(outvWestFinger,outvWestSum);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
catch//出现异常
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vWestCatch=true;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vWestTick=Environment.TickCount-vWestTick;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
#endregion出拳
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
出现异常#region出现异常
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vEastCatch||vWestCatch)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vEastCatch)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
eastTotal-=catchPenalty;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
westTotal++;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vWestCatch)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
westTotal-=catchPenalty;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
eastTotal++;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
break;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
#endregion出现异常
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
超时处理#region超时处理
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vEastTick>1000||vWestTick>1000)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vEastTick>1000)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Console.WriteLine("{0}出拳严重超时",typeof(T1).Name);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vWestTick>1000)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Console.WriteLine("{0}出拳严重超时",typeof(T2).Name);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vEastTick>100)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vEastResult=Result.Overtime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
eastOvertime++;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vWestTick>100)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vWestResult=Result.Overtime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
westOvertime++;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
#endregion超时处理
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
判断谁犯规#region判断谁犯规
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vEastResult==Result.Unknown)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vEastSum<0||vEastSum>10||
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vEastFinger<0||vEastFinger>5||
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vEastSum-5>vEastFinger||vEastFinger>vEastSum)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vEastResult=Result.Foul;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vWestResult==Result.Unknown)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vWestSum<0||vWestSum>10||
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vWestFinger<0||vWestFinger>5||
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vWestSum-5>vWestFinger||vWestFinger>vWestSum)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vWestResult=Result.Foul;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
#endregion判断谁犯规
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
有一个人犯规#region有一个人犯规
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vEastResult==Result.Foul^vWestResult==Result.Foul)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
如犯规判则对方赢#region如犯规判则对方赢
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vEastResult==Result.Foul)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vWestResult=Result.Win;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
elseif(vWestResult==Result.Foul)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vEastResult=Result.Win;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
#endregion如犯规判则对方赢
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
#endregion有一个人犯规
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
划拳比较#region划拳比较
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vEastResult==Result.Unknown)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vEastFinger+vWestFinger==vEastSum)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vEastResult=Result.Win;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vWestResult==Result.Unknown)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vEastFinger+vWestFinger==vWestSum)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vWestResult=Result.Win;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
#endregion划拳比较
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
平局#region平局
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vEastResult==vWestResult)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vEastResult=Result.Dogfall;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vWestResult=Result.Dogfall;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
#endregion平局
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
出现胜负#region出现胜负
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vEastResult==Result.Win||vWestResult==Result.Win)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vEastResult==Result.Win)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
eastTotal++;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vWestResult=Result.Lost;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
elseif(vWestResult==Result.Win)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
westTotal++;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vEastResult=Result.Lost;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
#endregion出现胜负
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
通知划拳的结果#region通知划拳的结果
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vEastTick=Environment.TickCount;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vEastCatch=false;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
try
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
eastPlayer.Outcome(vWestFinger,vWestSum,vWestResult,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vEastFinger,vEastSum,vEastResult);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
catch
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vEastCatch=true;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vEastTick=Environment.TickCount-vEastTick;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vWestTick=Environment.TickCount;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vWestCatch=false;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
try
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
westPlayer.Outcome(vEastFinger,vEastSum,vEastResult,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vWestFinger,vWestSum,vWestResult);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
catch
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vWestCatch=true;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
vWestTick=Environment.TickCount-vWestTick;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
#endregion通知划拳的结果
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
出现异常#region出现异常
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vEastCatch||vWestCatch)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vEastCatch)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
eastTotal-=catchPenalty;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
westTotal++;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vWestCatch)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
westTotal-=catchPenalty;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
eastTotal++;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
break;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
#endregion出现异常
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
超时处理#region超时处理
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vEastTick>1000||vWestTick>1000)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vEastTick>1000)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Console.WriteLine("{0}接收结果严重超时",typeof(T1).Name);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vWestTick>1000)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Console.WriteLine("{0}接收结果严重超时",typeof(T2).Name);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vEastTick>100)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
eastTotal-=overtimePenalty;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
eastOvertime++;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vWestTick>100)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
westTotal-=overtimePenalty;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
westOvertime++;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(eastOvertime>10||westOvertime>10)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(eastOvertime>10)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Console.WriteLine("{0}超时十次以上",typeof(T1).Name);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(westOvertime>10)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Console.WriteLine("{0}超时十次以上",typeof(T2).Name);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
#endregion超时处理
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
出现胜负#region出现胜负
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(vEastResult==Result.Win||vWestResult==Result.Win)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
break;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
#endregion出现胜负
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
#endregion猜拳过程
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
输出结果#region输出结果
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Console.WriteLine("{0}得分:{1},{2}得分:{3}",
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
typeof(T1).Name,eastTotal,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
typeof(T2).Name,westTotal);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Console.ReadLine();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
#endregion输出结果
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
publicclasszhangenter:Drunkard
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
privateRandomrandom;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
int[]betterFinger=newint[]...{0,0,5,5};
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
int[]betterSum=newint[]...{0,5,5,10};
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
intlastIndex=0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
publiczhangenter()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
random=newRandom();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
publicoverridevoidCome(outintAFinger,outintASum)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
AFinger=betterFinger[lastIndex];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
ASum=betterSum[lastIndex];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
publicoverridevoidOutcome(intAOtherFinger,intAOtherSum,ResultAOtherResult,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
intASelfFinger,intASelfSum,ResultASelfResult)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(ASelfResult!=Result.Win)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
intnewIndex;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
while((newIndex=random.Next(4))!=lastIndex)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
lastIndex=newIndex;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
classProgram
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
staticvoidMain(string[]args)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
newDrunkery<Zswang二号,zhangenter>().Play();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}