CSDN-CSDN社区-.NET技术-C#

收藏 [推荐] 【编程游戏】划拳机器人,前面一贴的机器人都集中来了,继续PK。谨慎路过。[问题点数:400,结帖人:zswang]

  • zswang
  • (伴水 清洁工 看帖要回贴)
  • 等 级:
  • 结帖率:
楼主发表于:2008-04-23 21:25:31
参考上一贴:【编程游戏】编写一个会划拳的机器人参加擂台赛,规则内详。路过有分。
不过上一帖的楼太高、打开太慢,所以我把那些机器人集中到这PK
打败对手最多的机器人获胜!奖励200分,其余酌情散掉。。。

划拳规则看完了,那我们就开始写一个会划拳的机器人吧!

    那么一个会划拳的机器会做什么事情呢?其实就是两件:
第一件、出拳,即:自己出几个手指?自己猜合计是多少。
第二件、知道划拳的结果,即:对方出几个手指,对方猜合计是多少,是否获胜还是平局还是其他。

  只要继承Drunkard这个类,重载Come()和Outcome()方法那么你就拥有了一个会划拳的机器人,参与这个游戏了!

【游戏规则】
1、比赛共1000局,即:出现胜负算一局,如出拳100次没有结果也算一局并双方均不得分;
2、赢一局得1分、输不扣分;
3、机器人执行中每出现一次异常,扣100分、对方加1分、记一局;
4、机器人执行中反应超时1000毫秒直接判负,每超时100毫秒,扣1分,超时10次以上直接判负;
5、自己得分高于对手并大于600分判胜;
6、自己得分为正数对手得分为负数判胜;
7、其他情况则判平。
具体执行的过程,算法的过程请参考Drunkery <T1, T2>类的实现

【入门提示】
1、机器人的命名建议是: <自己的id> +  <第几个> + "号",如:Zswang一号、Zswang二号,当然你也可以用“长江七号”
  注意不用重名,重名会给比赛带来不便
2、不允许修改Drunkard和Drunkery <T1, T2>;
3、机器人必须从Drunkard继承;
4、分析擂主代码是战胜擂主的关键;
5、打擂容易守擂难,大家自由发挥吧!

谢谢关注

先帖调试代码:
C# code
using System; using System.Collections.Generic; using System.Text; namespace Huaquan { /// <summary> /// 划拳结果 /// </summary> public enum Result { /// <summary> /// 未知,还没开始判断 /// </summary> Unknown, /// <summary> /// 平局,结果一致 /// </summary> Dogfall, /// <summary> /// 胜,猜中结果 /// </summary> Win, /// <summary> /// 负,对方猜中结果,自己没有猜中 /// </summary> Lost, /// <summary> /// 犯规, /// </summary> Foul, /// <summary> /// 超时,反应时间超出100毫秒 /// </summary> Overtime } /// <summary> /// 酒鬼类 /// </summary> public abstract class Drunkard { /// <summary> /// 出拳 /// </summary> /// <param name="ANumber">出的手指数</param> /// <param name="ASum">猜的合计</param> abstract public void Come(out int AFinger, out int ASum); /// <summary> /// 接收结果 /// </summary> /// <param name="AOtherFinger">对方出的手指数</param> /// <param name="AOtherSum">对方猜的合计</param> /// <param name="AOtherResult">对方划拳的结果</param> /// <param name="ASelfFinger">自己出的手指数</param> /// <param name="ASelfSum">自己猜的合计</param> /// <param name="ASelfResult">自己划拳的结果</param> abstract public void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult); } public class Zswang一号 : Drunkard { public override void Come(out int AFinger, out int ASum) { AFinger = 5; // 每次都出5 ASum = 10; // 每次都猜10 } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { /* 这机器人不关心比赛结果 */ } } public class Zswang二号 : Drunkard { private Random random; public Zswang二号() { random = new Random(); } public override void Come(out int AFinger, out int ASum) { ASum = random.Next(10 + 1); //0-10 if (ASum < 5) // 别犯规 AFinger = random.Next(ASum + 1); else AFinger = random.Next(ASum - 5, 5 + 1); } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { /* 这机器人也不关心比赛结果 */ } } /// <summary> /// 酒馆类 /// </summary> /// <typeparam name="T1">划拳机器人1</typeparam> /// <typeparam name="T2">划拳机器人2</typeparam> public class Drunkery<T1, T2> where T1 : Drunkard, new() where T2 : Drunkard, new() { /// <summary> /// 东家 /// </summary> private Drunkard eastPlayer; /// <summary> /// 西家 /// </summary> private Drunkard westPlayer; /// <summary> /// 东家积分 /// </summary> private int eastTotal; /// <summary> /// 西家积分 /// </summary> private int westTotal; /// <summary> /// 东家超时次数 /// </summary> private int eastOvertime; /// <summary> /// 西家超时次数 /// </summary> private int westOvertime; /// <summary> /// 划拳次数 /// </summary> public const int comeCount = 1000; /// <summary> /// 超时罚分 /// </summary> public const int overtimePenalty = 1; /// <summary> /// 异常罚分 /// </summary> public const int catchPenalty = 100; /// <summary> /// 开始比赛 /// </summary> public void Play() { #region 初始化 long vEastTick = Environment.TickCount; // 东家初始化的时间 eastPlayer = new T1(); vEastTick = Environment.TickCount - vEastTick; long vWestTick = Environment.TickCount; // 西家初始化的时间 westPlayer = new T2(); vWestTick = Environment.TickCount - vWestTick; eastTotal = 0; westTotal = 0; eastOvertime = 0; westOvertime = 0; #region 超时处理 if (vEastTick > 1000 || vWestTick > 1000) { if (vEastTick > 1000) Console.WriteLine("{0}初始化严重超时", typeof(T1).Name); if (vWestTick > 1000) Console.WriteLine("{0}初始化严重超时", typeof(T2).Name); return; } if (vEastTick > 100) { eastTotal -= overtimePenalty; eastOvertime++; } if (vWestTick > 100) { westTotal -= overtimePenalty; westOvertime++; } #endregion 超时处理 #endregion 初始化 #region 猜拳过程 for (int i = 0; i < comeCount; i++) { for (int j = 0; j < 100; j++) { int vEastFinger = 0, vWestFinger = 0; int vEastSum = 0, vWestSum = 0; Result vEastResult = Result.Unknown; Result vWestResult = Result.Unknown; #region 出拳 bool vEastCatch = false; vEastTick = Environment.TickCount; // 东家出拳的时间 try { eastPlayer.Come(out vEastFinger, out vEastSum); } catch // 出现异常 { vEastCatch = true; } vEastTick = Environment.TickCount - vEastTick; bool vWestCatch = false; vWestTick = Environment.TickCount; // 西家出拳的时间 try { westPlayer.Come(out vWestFinger, out vWestSum); } catch // 出现异常 { vWestCatch = true; } vWestTick = Environment.TickCount - vWestTick; #endregion 出拳 #region 出现异常 if (vEastCatch || vWestCatch) { if (vEastCatch) { eastTotal -= catchPenalty; westTotal++; } if (vWestCatch) { westTotal -= catchPenalty; eastTotal++; } break; } #endregion 出现异常

回复次数:155
#1楼 得分:0回复于:2008-04-23 21:26:29
C# code
#region 超时处理 if (vEastTick > 1000 || vWestTick > 1000) { if (vEastTick > 1000) Console.WriteLine("{0}出拳严重超时", typeof(T1).Name); if (vWestTick > 1000) Console.WriteLine("{0}出拳严重超时", typeof(T2).Name); return; } if (vEastTick > 100) { vEastResult = Result.Overtime; eastOvertime++; } if (vWestTick > 100) { vWestResult = Result.Overtime; westOvertime++; } #endregion 超时处理 #region 判断谁犯规 if (vEastResult == Result.Unknown) if (vEastSum < 0 || vEastSum > 10 || vEastFinger < 0 || vEastFinger > 5 || vEastSum - 5 > vEastFinger || vEastFinger > vEastSum) vEastResult = Result.Foul; if (vWestResult == Result.Unknown) if (vWestSum < 0 || vWestSum > 10 || vWestFinger < 0 || vWestFinger > 5 || vWestSum - 5 > vWestFinger || vWestFinger > vWestSum) vWestResult = Result.Foul; #endregion 判断谁犯规 #region 有一个人犯规 if (vEastResult == Result.Foul ^ vWestResult == Result.Foul) { #region 如犯规判则对方赢 if (vEastResult == Result.Foul) vWestResult = Result.Win; else if (vWestResult == Result.Foul) vEastResult = Result.Win; #endregion 如犯规判则对方赢 } #endregion 有一个人犯规 #region 划拳比较 if (vEastResult == Result.Unknown) if (vEastFinger + vWestFinger == vEastSum) vEastResult = Result.Win; if (vWestResult == Result.Unknown) if (vEastFinger + vWestFinger == vWestSum) vWestResult = Result.Win; #endregion 划拳比较 #region 平局 if (vEastResult == vWestResult) { vEastResult = Result.Dogfall; vWestResult = Result.Dogfall; } #endregion 平局 #region 出现胜负 if (vEastResult == Result.Win || vWestResult == Result.Win) { if (vEastResult == Result.Win) { eastTotal++; vWestResult = Result.Lost; } else if (vWestResult == Result.Win) { westTotal++; vEastResult = Result.Lost; } } #endregion 出现胜负 #region 通知划拳的结果 vEastTick = Environment.TickCount; vEastCatch = false; try { eastPlayer.Outcome(vWestFinger, vWestSum, vWestResult, vEastFinger, vEastSum, vEastResult); } catch { vEastCatch = true; } vEastTick = Environment.TickCount - vEastTick; vWestTick = Environment.TickCount; vWestCatch = false; try { westPlayer.Outcome(vEastFinger, vEastSum, vEastResult, vWestFinger, vWestSum, vWestResult); } catch { vWestCatch = true; } vWestTick = Environment.TickCount - vWestTick; #endregion 通知划拳的结果 #region 出现异常 if (vEastCatch || vWestCatch) { if (vEastCatch) { eastTotal -= catchPenalty; westTotal++; } if (vWestCatch) { westTotal -= catchPenalty; eastTotal++; } break; } #endregion 出现异常 #region 超时处理 if (vEastTick > 1000 || vWestTick > 1000) { if (vEastTick > 1000) Console.WriteLine("{0}接收结果严重超时", typeof(T1).Name); if (vWestTick > 1000) Console.WriteLine("{0}接收结果严重超时", typeof(T2).Name); return; } if (vEastTick > 100) { eastTotal -= overtimePenalty; eastOvertime++; } if (vWestTick > 100) { westTotal -= overtimePenalty; westOvertime++; } if (eastOvertime > 10 || westOvertime > 10) { if (eastOvertime > 10) Console.WriteLine("{0}超时十次以上", typeof(T1).Name); if (westOvertime > 10) Console.WriteLine("{0}超时十次以上", typeof(T2).Name); return; } #endregion 超时处理 #region 出现胜负 if (vEastResult == Result.Win || vWestResult == Result.Win) break; #endregion 出现胜负 } } #endregion 猜拳过程 #region 输出结果 Console.WriteLine("{0}得分:{1}, {2}得分:{3}", typeof(T1).Name, eastTotal, typeof(T2).Name, westTotal); Console.ReadLine(); #endregion 输出结果 } } class Program { static void Main(string[] args) { new Drunkery<Zswang一号, Zswang二号>().Play(); } } }
#2楼 得分:0回复于:2008-04-23 21:28:23
C# code
public class Zswang二号 : Drunkard { private Random random; public Zswang二号() { random = new Random(); } public override void Come(out int AFinger, out int ASum) { ASum = random.Next(10 + 1); //0-10 if (ASum < 5) // 别犯规 AFinger = random.Next(ASum + 1); else AFinger = random.Next(ASum - 5, 5 + 1); } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { /* 这机器人也不关心比赛结果 */ } } public class zhangenter : Drunkard { private Random random; int[] betterFinger = new int[] { 0, 0, 5, 5 }; int[] betterSum = new int[] { 0, 5, 5, 10 }; int lastIndex = 0; public zhangenter() { random = new Random(); } public override void Come(out int AFinger, out int ASum) { AFinger = betterFinger[lastIndex]; ASum = betterSum[lastIndex]; } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { if (ASelfResult != Result.Win) { int newIndex; while ((newIndex = random.Next(4)) != lastIndex) lastIndex = newIndex; } } } public class Zswang三号66楼 : Drunkard { private Random random; private int lessFour; private int lassFour; public Zswang三号66楼() { random = new Random(); lessFour = 0; lassFour = 0; } private int Finger() { int finger = 0; if (lessFour >= lassFour) finger = random.Next(5 + 1); //0-10 if (lessFour < lassFour) finger = 5; return finger; } public override void Come(out int AFinger, out int ASum) { AFinger = Finger(); //0-10 if (AFinger <= 4) ASum = 4; else ASum = 10; } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { if (ASelfResult == Result.Win) { if (ASelfSum == 4) lessFour++; else lassFour++; } } } public class Yuwenge : Drunkard { private Random random; public Yuwenge() { random = new Random(); } public override void Come(out int AFinger, out int ASum) { AFinger = 2; ASum = 2 + random.Next(99) % 5 + 1; } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { } } public class yunfeng007 : Drunkard { private Random random; private int lessFour; private int lassFour; private int otherlessFour; private int otherlassFour; public yunfeng007() { random = new Random(); lessFour = 0; lassFour = 0; otherlessFour = 0; otherlassFour = 0; } private int Finger() { int finger = 0; if (lessFour >= lassFour) finger = 1 + random.Next(3 + 1); //0-10 if (lessFour < lassFour) finger = 5; return finger; } public override void Come(out int AFinger, out int ASum) { AFinger = Finger(); //0-10 if (AFinger <= 4) ASum = 4; else ASum = 10; } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { if (AOtherFinger <= 4) ++otherlessFour; else ++otherlassFour; if (ASelfResult == Result.Win) { if (ASelfSum == 4) ++lessFour; else ++lassFour; } if (ASelfResult == Result.Lost || ASelfResult == Result.Unknown) { if (ASelfSum == 4 && otherlessFour <= otherlassFour) { --lessFour; ++lassFour; } else { --lassFour; ++lessFour; } } } } class hhhh : Drunkard { private Random random; public hhhh() { random = new Random(); } public override void Come(out int AFinger, out int ASum) { ASum = 6; //0-10 AFinger = random.Next(1, 6); } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { } } public class ren : Drunkard { public override void Come(out int AFinger, out int ASum) { Random random = new Random(); AFinger = 0; // 每次都出0 ASum = random.Next(1, 5); } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { } } class hhhh2 : Drunkard { private Random random; public hhhh2() { random = new Random(); } public override void Come(out int AFinger, out int ASum) { AFinger = 0; ASum = random.Next(1, 5); } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { } } class 守擂 : Drunkard { private Random random; public 守擂() { random = new Random(); } public override void Come(out int AFinger, out int ASum) { AFinger = random.Next(5); ASum = 5; } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { } } public class Linxu二号 : Drunkard { private Random random; public Linxu二号() { random = new Random(); } public override void Come(out int AFinger, out int ASum) { AFinger = random.Next(5); ASum = 4; } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { } } class 专打Linxu二号 : Drunkard { private Random random; public 专打Linxu二号() { random = new Random(); } public override void Come(out int AFinger, out int ASum) { AFinger = 5; ASum = random.Next(5) + 5; } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { } } class 守擂二号 : Drunkard { private Random random; public 守擂二号() { random = new Random(); } public override void Come(out int AFinger, out int ASum) { AFinger = random.Next(5); ASum = AFinger + random.Next(5); } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { } } public class Linxu三号 : Drunkard { private Random random; private Random random2; public Linxu三号() { random = new Random(); random2 = new Random(); } public override void Come(out int AFinger, out int ASum) { AFinger = random.Next(random2.Next(5)); ASum = 5; } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { } }
#3楼 得分:0回复于:2008-04-23 21:29:32
C# code
class 守擂三号 : Drunkard //yatobiaf二号 { private Random random; public 守擂三号() { random = new Random(); } public override void Come(out int AFinger, out int ASum) { AFinger = random.Next(6); ASum = 5; } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { } } class Linxu四号 : Drunkard { private Random random; public Linxu四号() { random = new Random(); } public override void Come(out int AFinger, out int ASum) { AFinger = 5; ASum = random.Next(5, 10); } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { } } public class Zswang三号 : Drunkard { private Random random; private bool is守擂三号 = true; // 对手是不是守擂三号? public Zswang三号() { random = new Random(); // 因为是伪随机,一毫秒内创建的随机种子是一样的 } public override void Come(out int AFinger, out int ASum) { if (is守擂三号) { #region 计算守擂三号出的数字 int vFinger = random.Next(6); // 这里可以猜测他是否用随机 #endregion 计算守擂三号出的数字 if (vFinger == 0) { AFinger = 1; ASum = 1; } else { AFinger = 5; ASum = vFinger + AFinger; } } else { AFinger = random.Next(6); // 骂我吧,内核就是:“守擂三号” ASum = 5; } } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { if (is守擂三号) // 擂主如是is守擂三号 { if (ASelfResult != Result.Win) // 输了?那对手就不是守擂三号了 { random = new Random(); // 重新生成随机数 } } } } public class nik_amis : Drunkard { public override void Come(out int AFinger, out int ASum) { Random r = new Random(76); int[] f = new int[] { 5, 3, 2, 4, 1, 0 }; AFinger = f[r.Next(0, 10) / 2]; ASum = r.Next(0, 2) * 5 + AFinger; if (r.Next(11) > 9) ASum = r.Next(1, 6) + AFinger; } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { } } class linxu五号 : Drunkard { private Random random; public linxu五号() { random = new Random(); } public override void Come(out int AFinger, out int ASum) { AFinger = random.Next(random.Next(7)); ASum = 5; } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { } } class 专打Zswang三号 : Drunkard { private Random random; public 专打Zswang三号() { random = new Random(); } public override void Come(out int AFinger, out int ASum) { AFinger = 5 - random.Next(6); if (AFinger == 5) ASum = 6; else ASum = 5 + AFinger; } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { } } public class yunfeng007二号 : Drunkard { private Random random; public yunfeng007二号() { random = new Random(); Finger = 0; } private static int Finger; public override void Come(out int AFinger, out int ASum) { AFinger = Finger; if (AFinger <= 4) ASum = 4; else ASum = 10; } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { Finger = NextFinger(ASelfResult, ASelfFinger, AOtherFinger); } private int NextFinger(Result SelfResult, int SelfFinger, int OtherFinger) { int finger = 0; if (SelfResult == Result.Win) { finger = SelfFinger; } if (SelfResult == Result.Lost || SelfResult == Result.Unknown || SelfResult == Result.Dogfall) { finger = OtherFinger + random.Next(4 - OtherFinger + 1); } return finger; } } class 专打Zlinxu五号 : Drunkard { private Random random; public 专打Zlinxu五号() { random = new Random(); } public override void Come(out int AFinger, out int ASum) { AFinger = random.Next(6); ASum = AFinger; } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { } } class 专打Zlinxu四号 : Drunkard { private Random random; public 专打Zlinxu四号() { random = new Random(); } public override void Come(out int AFinger, out int ASum) { AFinger = random.Next(6); ASum = AFinger + 5; } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { } } class 擂主4 : Drunkard { private Random random; public 擂主4() { random = new Random(); } public override void Come(out int AFinger, out int ASum) { for (int i = 0; i < random.Next(10); i++) { AFinger = random.Next(6); } AFinger = random.Next(6); ASum = 5; } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { } } public class yunfeng007二号210楼 : Drunkard { private Random random; public yunfeng007二号210楼() { random = new Random(); Finger = 0; } private static int Finger; public override void Come(out int AFinger, out int ASum) { AFinger = Finger; if (AFinger <= 4) ASum = 4; else ASum = 10; } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { Finger = NextFinger(ASelfResult, ASelfFinger, AOtherFinger); } private void Count(int OtherFinger) { } private int NextFinger(Result SelfResult, int SelfFinger, int OtherFinger) { int finger = 0; if (SelfResult == Result.Win) { finger = SelfFinger; } if (SelfResult == Result.Lost || SelfResult == Result.Unknown || SelfResult == Result.Dogfall) { finger = OtherFinger + random.Next(4 - OtherFinger + 1); } return finger; } } public class 剪刀一号 : Drunkard { private Random random; public 剪刀一号() { random = new Random(); } public override void Come(out int AFinger, out int ASum) { AFinger = 5; ASum = random.Next(6, 11); } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { } }
#4楼 得分:0回复于:2008-04-23 21:30:40
C# code
public class 专打yunfeng二号 : Drunkard { private Random random; public 专打yunfeng二号() { random = new Random(); } static int Finger = 5; public override void Come(out int AFinger, out int ASum) { AFinger = Finger; ASum = 9; } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { Finger = NextFinger(ASelfResult, ASelfFinger, AOtherFinger); } private int NextFinger(Result SelfResult, int SelfFinger, int OtherFinger) { int finger = 0; { if (SelfFinger == 5) finger = 4; else if (SelfFinger == 4) finger = 5; } return finger; } } public class yunfeng007二号188楼 : Drunkard { private Random random; public yunfeng007二号188楼() { random = new Random(); Finger = random.Next(6); } private static int Finger; public override void Come(out int AFinger, out int ASum) { AFinger = Finger; if (AFinger <= 4) ASum = 4; else ASum = 10; } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { Finger = NextFinger(ASelfResult, ASelfFinger, AOtherFinger); } private int NextFinger(Result SelfResult, int SelfFinger, int OtherFinger) { int finger = 0; if (SelfResult == Result.Win) { finger = SelfFinger; } if (SelfResult == Result.Lost || SelfResult == Result.Unknown || SelfResult == Result.Dogfall) { finger = OtherFinger + random.Next(4 - OtherFinger + 1); } return finger; } } public class ZhangenterCome : Drunkard { private Random random; Dictionary<int, int> figuerCount = new Dictionary<int, int>(); Dictionary<int, int> sumCount = new Dictionary<int, int>(); public ZhangenterCome() { random = new Random(); for (int i = 0; i <= 5; i++) { figuerCount.Add(i, 0); } for (int i = 0; i <= 10; i++) { sumCount.Add(i, 0); } } public override void Come(out int AFinger, out int ASum) { int otherMaxFinger, otherMaxFingerCount, otherMaxSum, otherMaxSumCount; GetMaxValue(figuerCount, out otherMaxFinger, out otherMaxFingerCount); GetMaxValue(sumCount, out otherMaxSum, out otherMaxSumCount); int warningFinger = otherMaxSum - otherMaxFinger; int mod = DateTime.Now.Millisecond % 2; if (otherMaxFingerCount > 2 * otherMaxSumCount) { mod = 0; } if (otherMaxSumCount > 2 * otherMaxFingerCount) { mod = 1; } if (mod == 0) { // 避免对方猜中手指 while (true) { //AFinger = random.Next(6); AFinger = (random.Next(1000) + DateTime.Now.Millisecond) % 6; if (AFinger != warningFinger) { break; } } ASum = otherMaxFinger + AFinger; } else { // 避免对方猜中总和 int warningSum = otherMaxSum; while (true) { ASum = otherMaxFinger + (random.Next(9) * DateTime.Now.Millisecond) % 6; if (ASum != warningSum) { break; } } AFinger = ASum - otherMaxFinger; } double count = 1; // 浪费点时间,把时间弄乱,反正楼主给的时间充裕 for (int i = 0; i < DateTime.Now.Millisecond % 98765; i++) { count *= random.Next(12345, 67890); count /= random.Next(12345, 67890); if (count % 987654321 == DateTime.Now.Millisecond % 54321) break; } } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { if (figuerCount.ContainsKey(AOtherFinger)) figuerCount[AOtherFinger]++; if (sumCount.ContainsKey(AOtherSum)) sumCount[AOtherSum]++; double count = 1; // 浪费点时间,把时间弄乱,反正楼主给的时间充裕 for (int i = 0; i < DateTime.Now.Millisecond % 98765; i++) { count *= random.Next(12345, 67890); count /= random.Next(12345, 67890); if (count % 987654321 == DateTime.Now.Millisecond % 54321) break; } } private void GetMaxValue(Dictionary<int, int> d, out int maxKey, out int maxValue) { maxValue = 0; maxKey = d[maxValue]; foreach (int k in d.Keys) { if (d[k] > maxValue) { maxValue = d[k]; maxKey = k; } } } } public class 专打yunfeng二号226楼 : Drunkard { private Random random; public 专打yunfeng二号226楼() { random = new Random(); } static int Finger = 5; public override void Come(out int AFinger, out int ASum) { AFinger = Finger; ASum = 9; } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { /* 这机器人关心比赛结果 */ Finger = NextFinger(ASelfResult, ASelfFinger, AOtherFinger); } private int NextFinger(Result SelfResult, int SelfFinger, int OtherFinger) { int finger = 0; { if (SelfFinger == 5) finger = 4; else if (SelfFinger == 4) finger = 5; } return finger; } }
#5楼 得分:0回复于:2008-04-23 21:31:37
C# code
public class 剪刀二号 : Drunkard { private Random random; System.Data.DataTable historyFinger = new System.Data.DataTable(); System.Data.DataTable historySum = new System.Data.DataTable(); int lookCount = 0; int lookTotalCount = 0; int comeTotalCount = 0; public 剪刀二号() { random = new Random(); lookTotalCount = random.Next(500, 1000); historyFinger.Columns.Add("OtherFinger", typeof(int)); historyFinger.Columns.Add("OtherFingerCount", typeof(int)); historySum.Columns.Add("OtherSum", typeof(int)); historySum.Columns.Add("OtherSumCount", typeof(int)); for (int i = 0; i <= 5; i++) { System.Data.DataRow dRow = historyFinger.NewRow(); dRow["OtherFinger"] = i; dRow["OtherFingerCount"] = 0; historyFinger.Rows.Add(dRow); } for (int i = 0; i <= 10; i++) { System.Data.DataRow dRow = historySum.NewRow(); dRow["OtherSum"] = i; dRow["OtherSumCount"] = 0; historySum.Rows.Add(dRow); } } public override void Come(out int AFinger, out int ASum) { lookCount++; comeTotalCount++; int minFingerCount = (int)historyFinger.Compute("min(OtherFingerCount)", ""); int minFinger = (int)historyFinger.Select(string.Format("OtherFingerCount={0}", minFingerCount))[0]["OtherFinger"]; int maxFingerCount = (int)historyFinger.Compute("max(OtherFingerCount)", ""); int maxFinger = (int)historyFinger.Select(string.Format("OtherFingerCount={0}", maxFingerCount))[0]["OtherFinger"]; int minSumCount = (int)historySum.Compute("min(OtherSumCount)", ""); int minSum = (int)historySum.Select(string.Format("OtherSumCount={0}", minSumCount))[0]["OtherSum"]; int maxSumCount = (int)historySum.Compute("max(OtherSumCount)", ""); int maxSum = (int)historySum.Select(string.Format("OtherSumCount={0}", maxSumCount))[0]["OtherSum"]; int sugguestFinger = maxFinger; if ((minFingerCount > 0) && (float)maxFingerCount / minFingerCount <= 1.1) { sugguestFinger = minFinger; } int suggestSum = maxSum; if ((minSumCount > 0) && maxSumCount / minSumCount <= 1.1) { sugguestFinger = minSum; } while (true) { AFinger = random.Next(6); if (AFinger + sugguestFinger == suggestSum) continue; ASum = AFinger + sugguestFinger; break; } } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { System.Data.DataRow dRow = historyFinger.Select(string.Format("OtherFinger={0}", AOtherFinger))[0]; dRow["OtherFingerCount"] = int.Parse(dRow["OtherFingerCount"].ToString()) + 1; dRow = historySum.Select(string.Format("OtherSum={0}", AOtherFinger))[0]; dRow["OtherSumCount"] = int.Parse(dRow["OtherSumCount"].ToString()) + 1; } } public class ZhangenterCome加强版 : Drunkard { private Random random; Dictionary<int, int> figuerCount = new Dictionary<int, int>(); Dictionary<int, int> sumCount = new Dictionary<int, int>(); public ZhangenterCome加强版() { random = new Random(); for (int i = 0; i <= 5; i++) { figuerCount.Add(i, 0); } for (int i = 0; i <= 10; i++) { sumCount.Add(i, 0); } } public override void Come(out int AFinger, out int ASum) { int otherMaxFinger, otherMaxFingerCount, otherMaxSum, otherMaxSumCount; bool mainFinger, mainSum; GetMaxValue(figuerCount, out otherMaxFinger, out otherMaxFingerCount, out mainFinger); GetMaxValue(sumCount, out otherMaxSum, out otherMaxSumCount, out mainSum); int warningFinger = otherMaxSum - otherMaxFinger; int mod = DateTime.Now.Millisecond % 2; if (mainFinger) { mod = 0; } else { otherMaxFinger = GetOtherMaxFinger(figuerCount); } if (mod == 0) { // 避免对方猜中手指 while (true) { AFinger = (random.Next(1000) + DateTime.Now.Millisecond) % 6; if (AFinger != warningFinger) { break; } } ASum = otherMaxFinger + AFinger; } else { // 避免对方猜中总和 int warningSum = otherMaxSum; while (true) { //otherMaxFinger = (random.Next(9) * DateTime.Now.Millisecond) % 6; ASum = otherMaxFinger + (random.Next(9) * DateTime.Now.Millisecond) % 6; if (ASum != warningSum) { break; } } AFinger = ASum - otherMaxFinger; } double count = 1; // 浪费点时间,把时间弄乱,反正楼主给的时间充裕 for (int i = 0; i < DateTime.Now.Millisecond % 98765; i++) { count *= random.Next(12345, 67890); count /= random.Next(12345, 67890); if (count % 987654321 == DateTime.Now.Millisecond % 54321) break; } } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { if (figuerCount.ContainsKey(AOtherFinger)) figuerCount[AOtherFinger]++; if (sumCount.ContainsKey(AOtherSum)) sumCount[AOtherSum]++; } private void GetMaxValue(Dictionary<int, int> d, out int maxKey, out int maxValue, out bool mainValue) { maxKey = 0; maxValue = d[maxKey]; int aboutMaxValue = maxValue; foreach (int k in d.Keys) { if (d[k] > maxValue) { aboutMaxValue = maxValue; maxValue = d[k]; maxKey = k; } } if (maxValue > aboutMaxValue * 2 + 1) mainValue = true; else mainValue = false; } private int GetOtherMaxFinger(Dictionary<int, int> d) { List<int> indexKeys = new List<int>(); foreach (int k in d.Keys) { for (int i = 0; i < d[k]; i++) { indexKeys.Add(k); } } if (indexKeys.Count == 0) return random.Next(6); else return indexKeys[random.Next(indexKeys.Count)]; } }
#6楼 得分:0回复于:2008-04-23 21:32:44
C# code
public class 酒彪子一号 : Drunkard { public int[] 对方猜的数的次数记录 = new int[6]; public int[] 对方出的数的次数记录 = new int[6]; public int[] 对方喊的和的次数记录 = new int[11]; public override void Come(out int AFinger, out int ASum) { List<int[]> 最优解集 = new List<int[]>(36); int 最佳分数 = int.MinValue; for (int i = 0; i < 6; i++) { for (int j = 0; j < 6; j++) { int sum = i + j; int 得分 = checked(-对方猜的数的次数记录[i] + 对方出的数的次数记录[j] - 对方喊的和的次数记录[sum]); if (得分 > 最佳分数) { 最佳分数 = 得分; 最优解集.Clear(); } else if (得分 < 最佳分数) continue; 最优解集.Add(new int[] { i, j }); } } int[] 最优解 = 最优解集[new Random().Next(最优解集.Count)]; AFinger = 最优解[0]; ASum = 最优解[1] + AFinger; } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { /* 这机器人关心比赛结果 */ 对方猜的数的次数记录[AOtherSum - AOtherFinger] = 对方猜的数的次数记录[AOtherSum - AOtherFinger] + 1; 对方出的数的次数记录[AOtherFinger] = 对方出的数的次数记录[AOtherFinger] + 1; 对方喊的和的次数记录[AOtherSum] = 对方喊的和的次数记录[AOtherSum] + 1; } } public class 剪刀三号 : Drunkard { private Random random; System.Data.DataTable historyTable = new System.Data.DataTable(); System.Data.DataTable suggestTable = new System.Data.DataTable(); public 剪刀三号() { random = new Random(); historyTable.Columns.Add("f", typeof(int)); historyTable.Columns.Add("c", typeof(int)); suggestTable.Columns.Add("m", typeof(int)); suggestTable.Columns.Add("c", typeof(int)); for (int i = 0; i <= 5; i++) { System.Data.DataRow drow = suggestTable.NewRow(); drow["m"] = i; drow["c"] = 0; suggestTable.Rows.Add(drow); drow = historyTable.NewRow(); drow["f"] = i; drow["c"] = 0; historyTable.Rows.Add(drow); } } public override void Come(out int AFinger, out int ASum) { System.Data.DataRow[] rows = suggestTable.Select("1=1", "c"); AFinger = (int)rows[0]["m"]; int iIndex = random.Next(2); rows = historyTable.Select("c>avg(c)", "c desc"); if (rows.Length == 0) { ASum = AFinger + random.Next(6); } else if (rows.Length == 1) { ASum = AFinger + (int)rows[0]["f"]; } else { ASum = AFinger + (int)rows[iIndex]["f"]; } } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { suggestTable.Rows[AOtherSum - AOtherFinger]["c"] = int.Parse(suggestTable.Rows[AOtherSum - AOtherFinger]["c"].ToString()) + 1; historyTable.Rows[AOtherFinger]["c"] = int.Parse(historyTable.Rows[AOtherFinger]["c"].ToString()) + 1; } } public class Zswang四号 : Drunkard { public override void Come(out int AFinger, out int ASum) { AFinger = int.MinValue; ASum = int.MaxValue; } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { } } public class yatobiaf_四号 : Drunkard { public int[] OtherGuess = new int[6]; public int[] OtherFinger = new int[6]; public int[] SelfGuess = new int[6]; public int[] SelfFinger = new int[6]; public int[] 判断智能机器人次数 = new int[2]; public int NextFinger = 0; bool isOtherClever = false;//判断对方是否为智能机器人 int i; public override void Come(out int AFinger, out int ASum) { AFinger = 0; ASum = 0; if (isOtherClever)//智能机器人,那我就出对方认为我最不可能出的牌 { int minIfingerd = int.MinValue; for (i = 0; i < 6; i++) { if (minIfingerd > SelfFinger[i]) { minIfingerd = SelfFinger[i]; AFinger = i; } } int maxIguess = int.MaxValue; for (i = 0; i < 6; i++) { if (maxIguess < SelfGuess[i]) { maxIguess = SelfGuess[i]; ASum = AFinger + i; } } } else //笨笨机器人,那我就猜对方最可能出的牌。 { int minGuess = int.MaxValue; for (i = 0; i < 6; i++) { if (minGuess > OtherGuess[i]) { minGuess = OtherGuess[i]; AFinger = i; } } int maxFinger = int.MinValue; for (i = 0; i < 6; i++) { if (maxFinger < OtherFinger[i]) { maxFinger = OtherFinger[i]; ASum = AFinger + i; } } } } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { OtherGuess[AOtherSum - AOtherFinger] = OtherGuess[AOtherSum - AOtherFinger] + 1; OtherFinger[AOtherFinger] = OtherFinger[AOtherFinger] + 1; SelfGuess[ASelfSum - ASelfFinger] = SelfGuess[ASelfSum - ASelfFinger] + 1; SelfFinger[ASelfFinger] = SelfFinger[ASelfFinger] + 1; if (ASelfResult == Result.Lost) isOtherClever = !isOtherClever; } } public class xx_一号 : Drunkard { public int[][] OldFingerNum = new int[6][]; public int[][] OldGuessNum = new int[11][]; int Counter = 0; Boolean isDogFall; int lastFinger; private Random random; public xx_一号() { random = new Random(); for (int i = 0; i < OldFingerNum.Length; i++) { OldFingerNum[i] = new int[1]; } for (int i = 0; i < OldGuessNum.Length; i++) { OldGuessNum[i] = new int[1]; } } public override void Come(out int AFinger, out int ASum) { if (Counter < 30) { AFinger = random.Next(6); ASum = AFinger + random.Next(6); } else { int OtherlikeFinger = GetTheMax(OldFingerNum); int OtherlikeSum = GetTheMax(OldGuessNum); AFinger = random.Next(6); if (isDogFall) { ASum = AFinger + lastFinger; } else { ASum = AFinger + OtherlikeFinger; } } } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { if (AOtherResult == Result.Dogfall) { isDogFall = true; lastFinger = AOtherFinger; } if (AOtherFinger <= 0 || AOtherFinger >= 5) { OldFingerNum[AOtherFinger][0]++; } if (AOtherSum <= 0 || AOtherSum >= 11) { OldGuessNum[AOtherSum][0]++; } Counter++; } public int GetTheMax(int[][] Value) { int MaxVaule = 0; int Counter = 0; for (int i = 0; i < Value.Length; i++) { if (MaxVaule < Value[i][0]) { MaxVaule = Value[i][0]; Counter = i; } } return Counter; } }
#7楼 得分:0回复于:2008-04-23 21:33:52
C# code
public class yatobiaf_四号修正版 : Drunkard { public int[] OtherGuess = new int[6]; public int[] OtherFinger = new int[6]; public int[] SelfGuess = new int[6]; public int[] SelfFinger = new int[6]; public int[] 判断智能机器人次数 = new int[2]; public int NextFinger = 0; bool isOtherClever = false;//判断对方是否为智能机器人 int i; public override void Come(out int AFinger, out int ASum) { AFinger = 0; ASum = 0; if (isOtherClever)//智能机器人,那我就出对方认为我最不可能出的牌 { int minIfingerd = int.MaxValue; for (i = 0; i < 6; i++) { if (minIfingerd > SelfFinger[i]) { minIfingerd = SelfFinger[i]; AFinger = i; } } int minIguess = int.MaxValue; for (i = 0; i < 6; i++) { if (minIguess > SelfGuess[i]) { minIguess = SelfGuess[i]; ASum = AFinger + i; } } } else //笨笨机器人,那我就猜对方最可能出的牌。 { int minGuess = int.MaxValue; for (i = 0; i < 6; i++) { if (minGuess > OtherGuess[i]) { minGuess = OtherGuess[i]; AFinger = i; } } int maxFinger = int.MinValue; for (i = 0; i < 6; i++) { if (maxFinger < OtherFinger[i]) { maxFinger = OtherFinger[i]; ASum = AFinger + i; } } } } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { OtherGuess[AOtherSum - AOtherFinger] = OtherGuess[AOtherSum - AOtherFinger] + 1; OtherFinger[AOtherFinger] = OtherFinger[AOtherFinger] + 1; SelfGuess[ASelfSum - ASelfFinger] = SelfGuess[ASelfSum - ASelfFinger] + 1; SelfFinger[ASelfFinger] = SelfFinger[ASelfFinger] + 1; if (ASelfResult == Result.Lost) isOtherClever = !isOtherClever; if (ASelfResult == Result.Win) 判断智能机器人次数[Convert.ToInt16(isOtherClever)]++; } } public class xx_一号b : Drunkard { public int[][] OldFingerNum = new int[6][]; public int[][] OldGuessNum = new int[11][]; int Counter = 0; Boolean isDogFall; Boolean isSer; int lastFinger; private Random random; public xx_一号b() { random = new Random(); for (int i = 0; i < OldFingerNum.Length; i++) { OldFingerNum[i] = new int[1]; } for (int i = 0; i < OldGuessNum.Length; i++) { OldGuessNum[i] = new int[1]; } } public override void Come(out int AFinger, out int ASum) { if (Counter < 30) { AFinger = random.Next(6); ASum = AFinger + random.Next(6); } else { int OtherlikeFinger = GetTheMax(OldFingerNum); int OtherlikeSum = GetTheMax(OldGuessNum); AFinger = random.Next(6); if (isDogFall) { if (isSer) { ASum = AFinger + lastFinger + 1; } else { ASum = AFinger + lastFinger; } } else { ASum = AFinger + OtherlikeFinger; } } } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { if (AOtherResult == Result.Dogfall) { isDogFall = true; if (AOtherFinger - lastFinger == 1) { isSer = true; } lastFinger = AOtherFinger; } else { isDogFall = false; isSer = false; } Console.Write("Counter" + Counter + "对方出" + AOtherFinger + " 我出" + ASelfFinger + " 对方猜" + AOtherSum + " 我猜" + ASelfSum + " 结果" + ASelfResult + "\n"); if (AOtherFinger <= 0 || AOtherFinger >= 5) { } else { OldFingerNum[AOtherFinger][0]++; } if (AOtherSum <= 0 || AOtherSum >= 11) { } else { OldGuessNum[AOtherSum][0]++; } Counter++; } public int GetTheMax(int[][] Value) { int MaxVaule = 0; int Counter = 0; for (int i = 0; i < Value.Length; i++) { if (MaxVaule < Value[i][0]) { MaxVaule = Value[i][0]; Counter = i; } } return Counter; } }
#8楼 得分:0回复于:2008-04-23 21:34:31
C# code
public class ZhangenterCome黄金版 : Drunkard { private Random random; Dictionary<int, int> figuerCount = new Dictionary<int, int>(); Dictionary<int, int> sumCount = new Dictionary<int, int>(); Dictionary<int, int> selffiguerCount = new Dictionary<int, int>(); Dictionary<int, int> selfSumCount = new Dictionary<int, int>(); public ZhangenterCome黄金版() { random = new Random(); for (int i = 0; i <= 5; i++) { figuerCount.Add(i, 0); selffiguerCount.Add(i, 0); } for (int i = 0; i <= 10; i++) { sumCount.Add(i, 0); selfSumCount.Add(i, 0); } } public override void Come(out int AFinger, out int ASum) { int otherMaxFinger, otherMaxFingerCount, otherMaxSum, otherMaxSumCount, selfMaxFinger, selfMaxFingerCount; bool mainFinger, mainSum, selfMainFigure; GetMaxValue(figuerCount, out otherMaxFinger, out otherMaxFingerCount, out mainFinger); GetMaxValue(sumCount, out otherMaxSum, out otherMaxSumCount, out mainSum); GetMaxValue(selffiguerCount, out selfMaxFinger, out selfMaxFingerCount, out selfMainFigure); int warningFinger = otherMaxSum - otherMaxFinger; int mod = DateTime.Now.Millisecond % 2; if (!mainFinger) { warningFinger = GetSelfSuggestFinger(selffiguerCount); otherMaxFinger = GetOtherMaxFinger(figuerCount); } while (true) { AFinger = (random.Next(6) + DateTime.Now.Millisecond) % 6; ASum = otherMaxFinger + AFinger; if (mainFinger) { if (AFinger != warningFinger) { break; } } else { if (AFinger != selfMaxFinger && AFinger != warningFinger && ASum != otherMaxSum) { break; } } } double count = 1; // 浪费点时间,把时间弄乱,反正楼主给的时间充裕 for (int i = 0; i < DateTime.Now.Millisecond % 98765; i++) { count *= random.Next(12345, 67890); count /= random.Next(12345, 67890); if (count % 987654321 == DateTime.Now.Millisecond % 54321) break; } selffiguerCount[AFinger]++; selfSumCount[ASum]++; } public override void Outcome(int AOtherFinger, int AOtherSum, Result AOtherResult, int ASelfFinger, int ASelfSum, Result ASelfResult) { if (figuerCount.ContainsKey(AOtherFinger)) figuerCount[AOtherFinger]++; if (sumCount.ContainsKey(AOtherSum)) sumCount[AOtherSum]++; double count = 1; // 浪费点时间,把时间弄乱,反正楼主给的时间充裕 for (int i = 0; i < DateTime.Now.Millisecond % 98765; i++) { count *= random.Next(12345, 67890); count /= random.Next(12345, 67890); if (count % 987654321 == DateTime.Now.Millisecond % 54321) break; } } private void GetMaxValue(Dictionary<int, int> d, out int maxKey, out int maxValue, out bool mainValue) { maxKey = 0; maxValue = d[maxKey]; int aboutMaxValue = maxValue; foreach (int k in d.Keys) { if (d[k] > maxValue) { aboutMaxValue = maxValue; maxValue = d[k]; maxKey = k; } } if (maxValue > aboutMaxValue * 2 + 1) mainValue = true; else mainValue = false; } private int GetOtherMaxFinger(Dictionary<int, int> d) { List<int> indexKeys = new List<int>(); foreach (int k in d.Keys) { for (int i = 0; i < d[k]; i++) { indexKeys.Add(k); } } if (indexKeys.Count == 0) return random.Next(6); else return indexKeys[random.Next(indexKeys.Count)]; } private int GetSelfSuggestFinger(Dictionary<int, int> d) { List<int> indexKeys = new List<int>(); foreach (int k in d.Keys) { for (int i = 0; i < 1000 / (d[k] + 1); i++) { indexKeys.Add(k); } } if (indexKeys.Count == 0) return random.Next(6); else return indexKeys[random.Next(indexKeys.Count)]; } }



总算帖完,大家生产的机器人还不少啊!
#9楼 得分:1回复于:2008-04-23 21:35:33
这代码也太长了吧  LZ太历害了。。。。我用C#最多也只能写一个简单的小游戏。(爆炸小游戏)现在正在做着。。。还有些问题。。还得想想啊。
#10楼 得分:1回复于:2008-04-23 21:40:07
太强大了,佩服
  • wapit用户头像
  • wapit
  • (手机文件传输 wapit.cn)
  • 等 级:
#11楼 得分:1回复于:2008-04-23 21:44:10
搞晕了......
#12楼 得分:1回复于:2008-04-23 21:53:40
收藏
#13楼 得分:1回复于:2008-04-23 22:19:22
晕,这楼一起来就这么高。。。
楼住搞个代码下载吧,顺便改成winform的
复制结果也方便


#14楼 得分:1回复于:2008-04-23 22:31:03
好多机器人,评分要麻烦了
#15楼 得分:1回复于:2008-04-23 22:36:57
路过,接分哦!喝酒的时候玩过这个哦!
#16楼 得分:1回复于:2008-04-23 22:38:39
太多的机器人,评分很麻烦,在想想哦!
#17楼 得分:1回复于:2008-04-23 22:41:26
寒~~才十几楼就把滚动条压成硬币了...
#18楼 得分:50回复于:2008-04-24 02:50:22
#19楼 得分:1回复于:2008-04-24 07:33:04
路过。
#20楼 得分:1回复于:2008-04-24 08:12:07
太强大了!!
学习了!!
#21楼 得分:1回复于:2008-04-24 08:41:03
收藏~
#22楼 得分:1回复于:2008-04-24 09:11:57
我为编程狂,你青岛的?
#23楼 得分:1回复于:2008-04-24 09:14:16
强悍呀,除了佩服还是佩服!!
  • pxbs0用户头像
  • pxbs0
  • (jjyy)
  • 等 级:
#24楼 得分:1回复于:2008-04-24 09:26:16
在我的机器上酒彪子二号 得分为负数! 呵呵,这个线程的表现在各个机器上不一样啊
  • pxbs0用户头像
  • pxbs0
  • (jjyy)
  • 等 级:
#25楼 得分:1回复于:2008-04-24 09:52:19
建议楼主修改一个比赛规则,比如每个机器人都有自己的线程!判断的时候用messageQ来做结果接受!这个发挥的空间更大一些
  • pxbs0用户头像
  • pxbs0
  • (jjyy)
  • 等 级:
#26楼 得分:1回复于:2008-04-24 09:53:25
或者做个走迷宫机器人,或者干脆来个生命游戏,总之加强策略性!
  • pxbs0用户头像
  • pxbs0
  • (jjyy)
  • 等 级:
#27楼 得分:1回复于:2008-04-24 09:54:49
昨天弄了一晚上,基本上来说,还是随机最难取胜啊,这么快到瓶颈了,很难有发挥了
#28楼 得分:20回复于:2008-04-24 09:58:56
#29楼 得分:1回复于:2008-04-24 10:01:03
引用 26 楼 pxbs0 的回复:
或者做个走迷宫机器人,或者干脆来个生命游戏,总之加强策略性!


我也有这想法,剧情我都想好了
游戏内容很简单,但是环环相扣,肯定好玩
  • pxbs0用户头像
  • pxbs0
  • (jjyy)
  • 等 级:
#30楼 得分:0回复于:2008-04-24 10:32:01
我1427948贡献一个群,大家一起交流交流
#31楼 得分:0回复于:2008-04-24 11:00:18
拜一下18楼,很强,利用线程使对方超时将对方击倒!
这种算是出老千,而且容易误伤自己,呵呵
关于出老千,我觉得还可以通过分析Come()方法堆栈,获得Drunkery <T1, T2>的实例,然后将对手替换掉

不过,如何获得调用方法的实例我还没有找到。
目前止步于:
C# code
public override void Come(out int AFinger, out int ASum) { AFinger = random.Next(6); ASum = 5; StackTrace vStackTrace = new StackTrace(); foreach (StackFrame vStackFrame in vStackTrace.GetFrames()) { MethodBase vMethodBase = vStackFrame.GetMethod(); if (string.Compare(vMethodBase.Name, "Play", true) == 0) { Console.WriteLine(vMethodBase.Name); break; } } }


当然,做人要厚道;
抓住别人的弱点攻击没有问题,但不能抓住比赛平台的弱点攻击。
作为研究,关于出老千我们另行讨论,不参与正常比赛 ^o^
#34楼 得分:1回复于:2008-04-24 11:10:41
过路+接分+UP
#35楼 得分:1回复于:2008-04-24 11:37:03
一堆代码,看的晕了。。
#36楼 得分:1回复于:2008-04-24 12:54:34
咔咔
#37楼 得分:1回复于:2008-04-24 13:43:00
看了下那个东西,随机性太高了吧?通过研究上一个的算法然后写出一个可以打败它的,但是弄不好写到最后一个擂主的时候,它的机器人被第一个机器人打败了也说不准呢~
#38楼 得分:1回复于:2008-04-24 13:44:07
支持一下~
#39楼 得分:1回复于:2008-04-24 13:57:49
看的头晕,支持一下
  • aipass用户头像
  • aipass
  • (扫地僧)
  • 等 级:
#40楼 得分:1回复于:2008-04-24 14:08:03
太牛了,
我,还没入门
没看懂
你们都很牛!
#41楼 得分:1回复于:2008-04-24 14:11:58
楼主真强,收藏
#42楼 得分:1回复于:2008-04-24 14:23:26
强!18楼连出老千都整出来。
  • stning用户头像
  • stning
  • (群号:59567572)
  • 等 级:
#43楼 得分:1回复于:2008-04-24 15:03:44
引用 38 楼 dh20156 的回复:
支持一下~
#44楼 得分:1回复于:2008-04-24 15:12:25
很好很强大
  • hooyke用户头像
  • hooyke
  • (红旗下的蛋)
  • 等 级:
#45楼 得分:1回复于:2008-04-24 15:13:09
都是强人,进来崇拜一下!
#46楼 得分:1回复于:2008-04-24 15:15:21
MARK
#47楼 得分:1回复于:2008-04-24 15:22:51
收藏,回去研究伴水的精华,:)
#48楼 得分:1回复于:2008-04-24 15:29:26
强淫!学习
#49楼 得分:1回复于:2008-04-24 15:33:15
收。。。希望以后多有类似这样的帖子。。。感觉不错
  • lqs0112用户头像
  • lqs0112
  • (山外青山)
  • 等 级:
#50楼 得分:1回复于:2008-04-24 15:37:40
有点晕
#51楼 得分:1回复于:2008-04-24 16:11:10
看看,学习
  • ranmer用户头像
  • ranmer
  • (ranmer)
  • 等 级:
#52楼 得分:1回复于:2008-04-24 16:40:42
好强大,收藏了再说
#53楼 得分:3回复于:2008-04-24 16:47:31
前几天也想过这个问题,不过没时间搞。还是楼主比较能付诸行动,先向你学习了。不过我对游戏规则有点想法:
1.随机数是否要规定必须用自己的函数生成,而不是调用random(),这样对擂主的挑战会更大点,不然基本靠随机了。
2.可不可以,实时更新最新的擂主是谁,他的代码,这样就不用看完贴才知道是咋回事,毕竟大家都很忙,玩玩而已,不必太累了。
3.提供界面程序。这样趣味性更大。
#54楼 得分:1回复于:2008-04-24 17:09:39
晕了,看不明白,以前学的C#都忘了、、、
#55楼 得分:1回复于:2008-04-24 17:42:44
新人,都晕了,,
你很厉害啊
#56楼 得分:0回复于:2008-04-24 17:45:35
引用 53 楼 StudyFromEveryOne 的回复:
前几天也想过这个问题,不过没时间搞。还是楼主比较能付诸行动,先向你学习了。不过我对游戏规则有点想法:
1.随机数是否要规定必须用自己的函数生成,而不是调用random(),这样对擂主的挑战会更大点,不然基本靠随机了。
2.可不可以,实时更新最新的擂主是谁,他的代码,这样就不用看完贴才知道是咋回事,毕竟大家都很忙,玩玩而已,不必太累了。
3.提供界面程序。这样趣味性更大。
1、禁止使用随机数的意义不大,你完全可以根据内核代码自己写一个
Delphi(Pascal) code
uses SysConst; //这是我照内核翻译的Random代码 type TRandom = class private inext: Integer; inextp: Integer; SeedArray: array of Integer; function GetSampleForLargeRange: Double; function InternalSample: Integer; function Sample: Double; public constructor Create; overload; constructor Create(Seed: Integer); overload; function Next: Integer; overload; function Next(maxValue: Integer): Integer; overload; function Next(minValue, maxValue: Integer): Integer; overload; function NextDouble: Double; overload; procedure NextBytes(var buffer; size: Integer); end; { TRandom } constructor TRandom.Create(Seed: Integer); var num2, num3: Integer; i, j, k: Integer; index: Integer; begin SetLength(SeedArray, $38); num2 := $9a4ec86 - Abs(Seed); SeedArray[$37] := num2; num3 := 1; for i := 1 to $37 - 1 do begin index := ($15 * i) mod $37; SeedArray[index] := num3; num3 := num2 - num3; if num3 < 0 then Inc(num3, $7fffffff); num2 := SeedArray[index]; end; for j := 1 to 5 - 1 do begin for k := 1 to $38 - 1 do begin SeedArray[k] := SeedArray[k] - SeedArray[1 + ((k + 30) mod $37)]; if SeedArray[k] < 0 then Inc(SeedArray[k], $7fffffff); end; end; inext := 0; inextp := $15; end; constructor TRandom.Create; begin Create(GetTickCount); end; function TRandom.GetSampleForLargeRange: Double; var num, num2: Double; begin num := InternalSample; if InternalSample mod 2 <> 0 then num := -num; num2 := num + 2147483646.0; Result := num2 / 4294967293; end; function TRandom.InternalSample: Integer; var inext, inextp: Integer; num: Integer; begin inext := Self.inext; inextp := Self.inextp; Inc(inext); if inext >= $38 then inext := 1; Inc(inextp); if inextp >= $38 then inextp := 1; num := SeedArray[inext] - SeedArray[inextp]; if num < 0 then Inc(num, $7fffffff); SeedArray[inext] := num; Self.inext := inext; Self.inextp := inextp; Result := num; end; function TRandom.Next: Integer; begin Result := InternalSample; end; function TRandom.Next(maxValue: Integer): Integer; begin if maxValue < 0 then raise ERangeError.CreateRes(@SRangeError); Result := Trunc(Sample * maxValue); end; function TRandom.Next(minValue, maxValue: Integer): Integer; var num: Int64; begin if minValue > maxValue then raise ERangeError.CreateRes(@SRangeError); num := maxValue - minValue; if num <= $7fffffff then Result := Trunc(Sample * num) + minValue else Result := Trunc(GetSampleForLargeRange * num) + minValue; end; procedure TRandom.NextBytes(var buffer; size: Integer); var I: Integer; begin for I := 0 to size - 1 do PChar(buffer)[I] := Char(InternalSample mod $100); end; function TRandom.NextDouble: Double; begin Result := Sample; end; function TRandom.Sample: Double; begin Result := InternalSample * 4.6566128752457969E-10; end;

2、目前是看谁战胜的机器人数量最多,而不是打败专门的机器人,就没有擂主一说了
3、有个界面是不错的想法。在设计下一个游戏的时候就考虑。
#57楼 得分:1回复于:2008-04-24 18:09:33
进来祟拜下。。
#58楼 得分:1回复于:2008-04-24 19:02:43
占个位置,坐山观虎斗;
#59楼 得分:1回复于:2008-04-24 19:52:26
弓虽
#60楼 得分:1回复于:2008-04-24 20:15:14
崇拜牛人~学习中!
#61楼 得分:1回复于:2008-04-24 22:04:43
是啊
#62楼 得分:2回复于:2008-04-24 22:15:18
  伴水兄,我在写出千的算法之前,也从道德上谴责了自己一顿。我也认为赢就应该光明正大。
  但我写完后就不这么想了,写这个程序,最大的收获就是复习并学习了多线程的用法。我认为,这才是参与擂台的真正目的,提高自己的编程水平,或算数水平。目前算数方面没有什么突破的话,不如试试在编程角度百家争鸣。搞不好会有精彩的编程代码出现。
#63楼 得分:1回复于:2008-04-24 22:34:58
mark 5.1放假来玩玩
  • dyjqk用户头像
  • dyjqk
  • (大帅)
  • 等 级:
#64楼 得分:1回复于:2008-04-24 22:45:17
up
#65楼 得分:2回复于:2008-04-24 22:51:53
  有个想法,可惜我的功力不够,希望能看到高人的代码。
  在自己的come()结束时更改程序的安全权限,让主程序不允许调用派生的方法,一调用对方的come()就抛异常,从而取胜。

  还有就是调用API方法扫描主程序的变量堆栈,修改对方的计时参考值,是对方超时出局,可惜我也写不出来,期待高人!
#66楼 得分:0回复于:2008-04-24 23:41:13
引用 65 楼 Q_282898034 的回复:
有个想法,可惜我的功力不够,希望能看到高人的代码。
在自己的come()结束时更改程序的安全权限,让主程序不允许调用派生的方法,一调用对方的come()就抛异常,从而取胜。
还有就是调用API方法扫描主程序的变量堆栈,修改对方的计时参考值,是对方超时出局,可惜我也写不出来,期待高人!
第一点和我想的将对手替换掉如出一辙,第二点可以用变速齿轮的方法,实现起来难!
我只是说"出老千"的方法不参加正式比赛,没说不研究,呵呵。。。
#67楼 得分:0回复于:2008-04-24 23:44:06
另外,执行的时机不一定要等到Come()方法的调用,在构造对象的时候、在静态字段初始化的时候,更占先机。
#68楼 得分:1回复于:2008-04-25 01:47:00
不地道不地道,都开始走邪门歪路了,对托管代码做手脚却是比较难...
#69楼 得分:1回复于:2008-04-25 09:02:47
如此好贴 要顶
  • TLJewel用户头像
  • TLJewel
  • (GogO__天堑)
  • 等 级:
#70楼 得分:1回复于:2008-04-25 09:19:00
太强大了,收藏学习。
  • TLJewel用户头像
  • TLJewel
  • (GogO__天堑)
  • 等 级:
#71楼 得分:0回复于:2008-04-25 09:30:18
又看了一遍,可惜没有时间仔细研究,而且我是新手,见笑了。写完文档明天好好研究下,一定能学到不少知识~1
  本贴亮点人物~::18楼的兄弟,好强。
#72楼 得分:1回复于:2008-04-25 09:38:15
引用 68 楼 jinjazz 的回复:
不地道不地道,都开始走邪门歪路了,对托管代码做手脚却是比较难...

怎么不地道了,我觉得很好啊,编程这样才有乐趣嘛,强烈顶出老千的!
另外酒彪子二号的“2”是不是指从现在到对方代码运行的时间,也就是自己程序运行的时间啊?这个数不能测出来嘛?测试前十次出拳然后记录下来不就可以了?
#73楼 得分:1回复于:2008-04-25 09:48:49
昨天好像csdn上不了。我看了下我的yatobiaf_四号还有两个主要对手,一个是xx_一号b,他利用我代码平局时下一次肯定出一样的拳这点攻击我,我可以稍微修改一下就可以,而且他自身代码也有bug,经常出foul,所以不足为俱,一个是ZhangenterCome黄金版,这是个很强大的对手,他自己出的拳几乎很随机(只是不会出最危险的那一个), 让我不能轻易判断对手是否智能机器人,我现在还没有找到很好的克制办法,除非另外写一个很针对他的新机器人。
#74楼 得分:1回复于:2008-04-25 10:08:46
jf
  • stlwhx用户头像
  • stlwhx
  • (上班了,才知道睡觉有多美!--)
  • 等 级:
#75楼 得分:1回复于:2008-04-25 10:16:02
引用 15 楼 english_fans 的回复:
路过,接分哦!喝酒的时候玩过这个哦!
#76楼 得分:1回复于:2008-04-25 10:48:58
mark下,有时间来玩...
#77楼 得分:1回复于:2008-04-25 12:44:05
额.. 这个太厉害了..

    初学中....  还有很多看不懂..
#78楼 得分:2回复于:2008-04-25 13:14:19
引用 72 楼 yatobiaf 的回复:
引用 68 楼 jinjazz 的回复:
不地道不地道,都开始走邪门歪路了,对托管代码做手脚却是比较难...

怎么不地道了,我觉得很好啊,编程这样才有乐趣嘛,强烈顶出老千的!
另外酒彪子二号的“2”是不是指从现在到对方代码运行的时间,也就是自己程序运行的时间啊?这个数不能测出来嘛?测试前十次出拳然后记录下来不就可以了?


我通过别的方法观察过,可惜干扰器线程的某个时间片的启动时间和结束时间不好掌握,在这方面的控制上,我也是个文盲,所以估计出个2来,并不适合所有对手和所有机器。
#79楼 得分:1回复于:2008-04-25 14:47:08
不知道 现在擂主是谁。。。
#80楼 得分:1回复于:2008-04-25 15:31:28
接著崇拜下。很好很强大。
  • jetmc用户头像
  • jetmc
  • (Jetmc)
  • 等 级:
#81楼 得分:1回复于:2008-04-25 15:49:03
还没有接触.
#82楼 得分:1回复于:2008-04-25 16:30:49
出来实习,做了一个多月劳工后,看此贴感慨,这才是编程,好怀念大2时候DS老师组织的算法大赛啊。
#83楼 得分:1回复于:2008-04-25 16:40:05
学习
  • rczjp用户头像
  • rczjp
  • (I'm God of Gamb)
  • 等 级:
#84楼 得分:1回复于:2008-04-25 16:58:18
LZ请问两个一样的对打的时候,结果怎么都是0呢?

请问^是异或的意思吗?是只有一个犯规才执行的意思吗?
那假如两个人都犯规的情况呢?为什么不用||呢? 我很菜 别笑话俺呵呵
C# code
#region 有一个人犯规 if (vEastResult == Result.Foul ^ vWestResult == Result.Foul) { #region 如犯规判则对方赢 if (vEastResult == Result.Foul) vWestResult = Result.Win; else if (vWestResult == Result.Foul) vEastResult = Result.Win; #endregion 如犯规判则对方赢 } #endregion 有一个人犯规
#85楼 得分:1回复于:2008-04-25 17:28:19
有点意思,闲着可以试试
#86楼 得分:0回复于:2008-04-25 17:34:40
引用 84 楼 rczjp 的回复:
LZ请问两个一样的对打的时候,结果怎么都是0呢?
请问^是异或的意思吗?是只有一个犯规才执行的意思吗?
那假如两个人都犯规的情况呢?为什么不用 ¦ ¦呢? 我很菜 别笑话俺呵呵
两个人都犯规就算平手了,没有一个人得分。所以不能用或(||)

true ^ false = true
false ^ true = true
false ^ false = false
true ^ true = false
#87楼 得分:13回复于:2008-04-26 00:41:01
ZhangenterCome黄金版得分:1000, Zswang一号得分:0
ZhangenterCome黄金版得分:508, Zswang二号得分:492
ZhangenterCome黄金版得分:880, zhangenter得分:120
ZhangenterCome黄金版得分:514, Zswang三号66楼得分:486
ZhangenterCome黄金版得分:1000, Yuwenge得分:0
ZhangenterCome黄金版得分:610, yunfeng007得分:390
ZhangenterCome黄金版得分:579, hhhh得分:421
ZhangenterCome黄金版得分:1000, ren得分:0
ZhangenterCome黄金版得分:999, hhhh2得分:1
ZhangenterCome黄金版得分:553, 守擂得分:447
ZhangenterCome黄金版得分:568, Linxu二号得分:432
ZhangenterCome黄金版得分:1000, 专打Linxu二号得分:0
ZhangenterCome黄金版得分:540, 守擂二号得分:460
ZhangenterCome黄金版得分:698, Linxu三号得分:302
ZhangenterCome黄金版得分:507, 守擂三号得分:493
ZhangenterCome黄金版得分:1000, Linxu四号得分:0
ZhangenterCome黄金版得分:999, Zswang三号得分:1
ZhangenterCome黄金版得分:1000, nik_amis得分:0
ZhangenterCome黄金版得分:700, linxu五号得分:300
ZhangenterCome黄金版得分:511, 专打Zswang三号得分:489
ZhangenterCome黄金版得分:677, yunfeng007二号得分:323
ZhangenterCome黄金版得分:521, 专打Zlinxu五号得分:479
ZhangenterCome黄金版得分:504, 专打Zlinxu四号得分:496
ZhangenterCome黄金版得分:507, 擂主4得分:493
ZhangenterCome黄金版得分:706, yunfeng007二号210楼得分:294
ZhangenterCome黄金版得分:1000, 剪刀一号得分:0
ZhangenterCome黄金版得分:637, 专打yunfeng二号得分:363
ZhangenterCome黄金版得分:690, yunfeng007二号188楼得分:310
ZhangenterCome黄金版得分:1000, ZhangenterCome得分:0
ZhangenterCome黄金版得分:653, 专打yunfeng二号226楼得分:347
ZhangenterCome黄金版得分:778, 剪刀二号得分:222
ZhangenterCome黄金版得分:542, ZhangenterCome加强版得分:458
ZhangenterCome黄金版得分:531, 酒彪子一号得分:469
ZhangenterCome黄金版得分:670, 剪刀三号得分:330
ZhangenterCome黄金版得分:982, Zswang四号得分:18
ZhangenterCome黄金版得分:850, yatobiaf_四号得分:150
ZhangenterCome黄金版得分:597, xx_一号得分:403
ZhangenterCome黄金版得分:635, yatobiaf_四号修正版得分:365
ZhangenterCome黄金版得分:658, xx_一号b得分:342

25胜14平0败,还有没有人在玩?
  • ilove8用户头像
  • ilove8
  • (菜菜子)
  • 等 级:
#88楼 得分:1回复于:2008-04-26 14:47:44
楼上好像是新擂主了
#89楼 得分:1回复于:2008-04-26 15:14:08
支持下
#90楼 得分:1回复于:2008-04-26 15:16:11
学习
  • rczjp用户头像
  • rczjp
  • (I'm God of Gamb)
  • 等 级:
#91楼 得分:1回复于:2008-04-26 15:21:42
谢谢LZ的回复
再请教一下
关于那个超时的处理 总共有三处都用到了
初始化的时候为什么要这样初始化
C# code
long vEastTick = Environment.TickCount; // 东家初始化的时间 eastPlayer = new T1(); vEastTick = Environment.TickCount - vEastTick;

这样的结果不是0吗?直接赋值0不可以吗?if (vEastTick > 1000 || vWestTick > 1000) 这样的情况是怎么出现的呢?
#92楼 得分:0回复于:2008-04-26 16:24:34
图Environment.TickCount属性表示机器开机以来流逝的时间,精确到毫秒。这里是计算或判断机器人构造耗费的时间是否超过1秒。
可以在构造的时候Thread.Sleep(2000)测试看看。
#93楼 得分:1回复于:2008-04-27 00:29:12
random 随机函数 在出现的数字(固定数字段)当中有没有一定的概率比.
能否根据此概率比来做一点文章?
比如说,在1000次的比赛过程中,利用概率分析学方面的知识来分析
前100次对方所出招数,得出的结果立刻用来服务于后900次比赛!
(这也是我的一个小小想法,不知怎样^ 大家探讨下)
  • 7712190用户头像
  • 7712190
  • (25458848@163.co)
  • 等 级:
#94楼 得分:50回复于:2008-04-27 01:40:00
  • iuhxq用户头像
  • iuhxq
  • (小灰(Svn服务器))
  • 等 级:
#95楼 得分:1回复于:2008-04-27 01:51:44
留个名,以后来学习
#96楼 得分:1回复于:2008-04-27 02:19:51
路过
刚开始学C#
#97楼 得分:1回复于:2008-04-27 08:54:54
路过..............
学习..................
  • rczjp用户头像
  • rczjp
  • (I'm God of Gamb)
  • 等 级:
#98楼 得分:2回复于:2008-04-27 13:21:38
恩 我发了帖之后也猜是LZ所说的 构造机器人要耗费时间
另外 for (int j = 0; j < 100; j++)这个为什么要呢
Outcome这个抽象方法好象还用不上//
  • m60a1用户头像
  • m60a1
  • (努力中.....)
  • 等 级:
#99楼 得分:2回复于:2008-04-27 14:03:09
18L严重范规哈,我们只能让程序走正路哈,如果讲范规的话,二个程序只能独立出来
分二个不同的进程进行比赛,还得搭个平台:)!
  • m60a1用户头像
  • m60a1
  • (努力中.....)
  • 等 级:
#100楼 得分:1回复于:2008-04-27 14:03:42
LZ N 强:)

make  !!!
相关问题
【编程游戏】编写一个会划拳的机器人参加擂台赛,规则内详。路过有分。