diff --git "a/\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Caipan.cs" "b/\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Caipan.cs" deleted file mode 100644 index 41678d3ec6254a216d0f015c1cc84d47dc9e2d25..0000000000000000000000000000000000000000 --- "a/\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Caipan.cs" +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ConsoleApp2 -{ - class Caipan - { - public void RuleSpeak() - { - Console.WriteLine("------欢迎进入游戏世界------"); - Console.WriteLine(); - Console.WriteLine("****************************"); - Console.WriteLine("*********猜拳,开始*********"); - Console.WriteLine("****************************"); - Console.WriteLine("出拳规则:1.剪刀 2.石头 3.布"); - } - public void returnup(string name,Heroname he,int counttime, int result1,int result2) - { - - Console.WriteLine("==================================="); - Console.WriteLine($"{name} vs {he}"); - Console.WriteLine($"对战次数:{counttime}"); - Console.WriteLine(); - Console.WriteLine($"姓名\t得分"); - Console.WriteLine($"{name}\t{result1}"); - Console.WriteLine($"{he}\t{result2}"); - Console.Write("结果:"); - result(name, he, result1, result2); - } - public void result(string name,Heroname he,int result1,int result2) - { - if (result1 > result2) - { - Console.WriteLine($"{name}赢,{he}笨蛋"); - } - else if(result1 > result2) - { - Console.WriteLine($"{he}赢,{name}笨蛋"); - } - else - { - Console.WriteLine("平局!"); - } - } - public void Shibai(string name) - { - Console.WriteLine($"笨蛋,{name}输了"); - } - public void Win(string name) - { - Console.WriteLine($"恭喜,{name}赢了"); - } - public void He() - { - Console.WriteLine("和局,真衰!嘿嘿,等着瞧吧!"); - } - } -} \ No newline at end of file diff --git "a/\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Cc.cs" "b/\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Cc.cs" deleted file mode 100644 index f53b9dd8c9d5d2f5b9184a49890a2f1a20abfcd4..0000000000000000000000000000000000000000 --- "a/\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Cc.cs" +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ConsoleApp2 -{ - class Cc : Hero - { - public Cc(string name, int age, char sex) : base(name, age, sex) - { - base.Name = name; - base.Age = age; - base.Sex = sex; - } - public override void yuyin() - { - Console.WriteLine($"在下{base.Name},后会有期~"); - } - public override void chu() - { - - } - } -} diff --git "a/\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Computer.cs" "b/\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Computer.cs" deleted file mode 100644 index 6316148b9860f879a07fc5800e5d27a66551817d..0000000000000000000000000000000000000000 --- "a/\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Computer.cs" +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ConsoleApp2 -{ - enum chuquanf - { - 剪刀=1, - 石头=2, - 布=3 - } - class Computer - { - Random rd = new Random(); - string[] arr = new string[3]; - int temp = 0; - int max = 3; - int min = 1; - //chuquanf cq = (chuquanf)Enum.Parse(typeof(chuquanf), rd); - public void chuquan() - { - - } - } -} diff --git "a/\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Hero.cs" "b/\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Hero.cs" deleted file mode 100644 index b77c9584ec9d7403ca7e6008feee07edcc6698ea..0000000000000000000000000000000000000000 --- "a/\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Hero.cs" +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ConsoleApp2 -{ - abstract class Hero - { - private string name; - private int age; - private char sex; - public Hero() - { } - public Hero(string name, int age, char sex) - { - this.name = name; - this.age = age; - this.sex = sex; - } - - public string Name - { - get { return this.name; } - set { this.name = value; } - } - - public int Age { get => age; set => age = value; } - public char Sex { get => sex; set => sex = value; } - public abstract void yuyin(); - public abstract void chu(); - } -} diff --git "a/\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Liubei.cs" "b/\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Liubei.cs" deleted file mode 100644 index 0dd9312d45d7fb2a7fc69bdf12fb7bbb77aa5390..0000000000000000000000000000000000000000 --- "a/\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Liubei.cs" +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ConsoleApp2 -{ - class Liubei : Hero - { - public Liubei() { } - public Liubei(string name, int age, char sex) : base(name, age, sex) - { - base.Name = name; - base.Age = age; - base.Sex = sex; - } - public override void yuyin() - { - Console.WriteLine("在下{0},请多多指教。",base.Name); - } - public override void chu() - { - - } - } -} diff --git "a/\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Me.cs" "b/\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Me.cs" deleted file mode 100644 index 2ae04473b508629e06fd55515e8e20f2e620077a..0000000000000000000000000000000000000000 --- "a/\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Me.cs" +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ConsoleApp2 -{ - class Me - { - - } -} diff --git "a/\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Program.cs" "b/\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Program.cs" deleted file mode 100644 index 40daa747b71bd7b4a2dcfe323c84707f94674e6a..0000000000000000000000000000000000000000 --- "a/\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Program.cs" +++ /dev/null @@ -1,246 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ConsoleApp2 -{ - public enum Heroname//枚举英雄 - { - 刘备=1, - 孙权=2, - 曹操=3 - } - public enum Chuquaning//枚举出拳 - { - 剪刀 = 1, - 石头 = 2, - 布 = 3 - } - class Program - { - static void Main(string[] args)//主方法 - { - Play(); - } - public static void Play() - { - Caipan cp = new Caipan();//实例化裁判 - cp.RuleSpeak();//引入裁判规则 - //while (true) - //{ - Console.WriteLine("请选择对方角色<1:刘备 2:孙权 3:曹操>"); - int heroname = int.Parse(Console.ReadLine()); - Heroname he = (Heroname)Enum.Parse(typeof(Heroname), heroname.ToString()); - //if (heroname.Equals(he.)) - //{ - Console.WriteLine("请输入您的名字:"); - string username = Console.ReadLine(); - - Console.WriteLine("{0} vs {1} 对战", username, he); - Console.WriteLine("开始游戏吗?"); - string yn = Console.ReadLine(); - YN(yn, username, he); - //} - //else - //{ - // Console.WriteLine("输入英雄不存在,请重新输入!"); - //} - //} - } - public static void Youxi(string name,Heroname he) - { - Caipan cb = new Caipan(); - - //我方出拳 - Console.WriteLine("请出拳:1.剪刀 2.石头 3.布(输入相应数字:)"); - int renchuquan = int.Parse(Console.ReadLine()); - Chuquaning cqr = (Chuquaning)Enum.Parse(typeof(Chuquaning), renchuquan.ToString()); - - //电脑随机出拳 - int computercq = GetRandomByGuid(0, 3); - Chuquaning cqc = (Chuquaning)Enum.Parse(typeof(Chuquaning), computercq.ToString()); - - //比较双方出拳结果 - Bijiao(renchuquan,computercq,cb,name,he,cqc,cqr); - } - public static void Bijiao(int renchuquan, int computercq, Caipan cb, string name, Heroname he, Chuquaning cqc, Chuquaning cqr) - { - int time = 0; - int rscore = 0; - int cscore = 0; - while (true) - { - time++; - switch (renchuquan) - { - case 1: - Console.WriteLine($"{name}:出拳:{cqr}"); - Console.WriteLine($"{he}:出拳:{cqc}"); - qinkuan1(renchuquan, computercq, cb, name, rscore, cscore); - break; - case 2: - Console.WriteLine($"{name}:出拳:{cqr}"); - Console.WriteLine($"{he}:出拳:{cqc}"); - qinkuan2(renchuquan, computercq, cb, name, rscore, cscore); - break; - case 3: - Console.WriteLine($"{name}:出拳:{cqr}"); - Console.WriteLine($"{he}:出拳:{cqc}"); - qinkuan3(renchuquan, computercq, cb, name, rscore, cscore); - break; - default: - Console.WriteLine("出拳错误,请重新输入!"); - break; - } - - Console.WriteLine("是否开始下一轮?"); - string b = Console.ReadLine(); - - YNyn(b, name, he, rscore, cscore, time); - } - } - private static void qinkuan3(int aa,int bb,Caipan cb,string name,int rscore,int cscore) - { - if (aa == bb) - { - cb.He(); - } - else if (aa != bb) - { - if (aa == 1) - { - cb.Shibai(name); - cscore++; - } - else if (aa == 2) - { - cb.Win(name); - rscore++; - } - } - else - { - Console.WriteLine("输入错误!"); - } - } - private static void qinkuan2(int aa, int bb, Caipan cb,string name, int rscore, int cscore) - { - if (aa == bb) - { - cb.He(); - } - else if (aa != bb) - { - if (aa == 1) - { - cb.Win(name); - rscore ++; - } - else if (aa == 3) - { - cb.Shibai(name); - cscore++; - } - } - else - { - Console.WriteLine("输入错误!"); - } - } - private static void qinkuan1(int ren, int cpu, Caipan cb, string name, int rscore, int cscore) - { - if (ren == cpu) - { - cb.He(); - } - else if (ren != cpu) - { - if (cpu == 2) - { - cb.Shibai(name); - cscore ++; - } - else if (cpu == 3) - { - cb.Win(name); - rscore++; - } - } - else - { - Console.WriteLine("输入错误!"); - } - } - static void Return(string name,Heroname he,int cishu,int rfs,int cfs) - { - Caipan cb = new Caipan(); - cb.returnup(name,he,cishu,rfs,cfs); - - Console.WriteLine("要开始下一局吗?"); - string xzxz = Console.ReadLine(); - YN(xzxz, name, he); - } - - private static void YN(string beginorend, string name, Heroname he) - { - if (beginorend == "y") - { - Youxi(name, he); - } - else if (beginorend == "Y") - { - Youxi(name, he); - } - else if (beginorend == "n") - { - Play(); - } - else if (beginorend == "N") - { - Play(); - } - else - { - Console.WriteLine("系统退出!"); - Environment.Exit(0); - } - } - private static void YNyn(string xz,string name, Heroname h,int rfengshu,int cfengshu,int time) - { - if (xz == "y") - { - Youxi(name,h); - } - else if (xz == "Y") - { - Youxi(name,h); - } - else if (xz == "n") - { - Return(name,h, time, rfengshu, cfengshu); - } - else if (xz == "N") - { - Return(name,h, time, rfengshu, cfengshu); - } - else - { - Console.WriteLine("系统退出!"); - Environment.Exit(0); - } - } - //电脑出拳 - private static int GetRandomByGuid(int min, int max) - { - Random ro = new Random(GetRandomSeedByGuid()); - int ronum = ro.Next(min, max); - return ronum; - } - static int GetRandomSeedByGuid() - { - return new Guid().GetHashCode(); - } - } -} \ No newline at end of file diff --git "a/\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Sunquan.cs" "b/\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Sunquan.cs" deleted file mode 100644 index 7a3a3500f37c484a3a5c29fac3e265176460b10d..0000000000000000000000000000000000000000 --- "a/\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Sunquan.cs" +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ConsoleApp2 -{ - class Sunquan : Hero - { - public Sunquan() { } - public Sunquan(string name, int age, char sex) : base(name, age, sex) - { - base.Name = name; - base.Age = age; - base.Sex = sex; - } - public override void yuyin() - { - Console.WriteLine($"{base.Name}在此,有何贵干?"); - } - public override void chu() - { - - } - } -} - diff --git "a/\351\203\221\347\276\216\345\251\267/\347\273\223\346\236\204\344\275\223/PersonClass.cs" "b/\351\203\221\347\276\216\345\251\267/\347\273\223\346\236\204\344\275\223/PersonClass.cs" deleted file mode 100644 index 273c08f242b78e70b9e6e1c6f77bf3fbb7ef4fad..0000000000000000000000000000000000000000 --- "a/\351\203\221\347\276\216\345\251\267/\347\273\223\346\236\204\344\275\223/PersonClass.cs" +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ConsoleApp1 -{ - class PersonClass - { - private string name; - private long phone; - private string adder; - - public PersonClass() - { } - public PersonClass(string name, long phone, string adder) - { - this.name = name; - this.phone = phone; - this.adder = adder; - } - - public string Name { get => name; set => name = value; } - public long Phone { get => phone; set => phone = value; } - public string Adder { get => adder; set => adder = value; } - } -} diff --git "a/\351\203\221\347\276\216\345\251\267/\347\273\223\346\236\204\344\275\223/Program.cs" "b/\351\203\221\347\276\216\345\251\267/\347\273\223\346\236\204\344\275\223/Program.cs" deleted file mode 100644 index 11a4d31eef788d99746e8e6f5becc366971e9499..0000000000000000000000000000000000000000 --- "a/\351\203\221\347\276\216\345\251\267/\347\273\223\346\236\204\344\275\223/Program.cs" +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ConsoleApp1 -{ - //定义一个结构体,名为PersonStruct,有三个成员变量:姓名、电话、地址, - //在主方法中,创建一个PersonStruct结构体对象p1,为p1的成员变量赋值。 - //再声明一个PersonStruct结构体变量p2,把p1赋值给p2,改变p2的姓名,打印p1的内容。 - - //定义一个类,名为PersonClass,有三个成员变量:姓名、电话、地址, - //在主方法中,创建一个PersonClass对象p3,为p3的成员变量赋值。 - //再声明一个PersonClass变量p4,把p3赋值给p4,改变p4的姓名,打印p3的内容。 - - - //观察打印结果,并在在注释中,说下你对此的认识(它们为什么会这样?) - class Program - { - /// - /// 它们为什么会这样? - /// 因为: - /// struct 有自己的存储空间,p1、p2相当于有两个分开的存储空间,p1的值赋值给p2,p1的值不会改变(p1有单独的存储空间)。 - /// class 是共有存储空间,p1、p2的值是相通的,p2值被改变,p1值同时被改变,反之亦然。 - /// - public struct PersonStruct - { - public string name; - public long phone; - public string adder; - } - static void Main(string[] args) - { - - PersonStruct p1 = new PersonStruct(); - p1.name = "阿珍"; - p1.phone =13520148521; - p1.adder = "上海老街"; - - PersonStruct p2 = new PersonStruct(); - p2 = p1; - p2.name = "阿强"; - Console.WriteLine(p1.name);//未改变 - - PersonClass p3 = new PersonClass(); - p3.Name = "阿珍爱上了阿强"; - p3.Phone = 12365485201; - p3.Adder = "夜上海"; - - PersonClass p4 = new PersonClass(); - p4 = p3; - p4.Name = "阿强爱上了阿珍"; - Console.WriteLine(p3.Name);//改变 - } - } -} diff --git "a/\351\237\246\346\230\214\345\235\244/\350\213\261\351\233\204\350\201\224\347\233\237\347\214\234\346\213\263\346\270\270\346\210\217/Ad.cs" "b/\351\237\246\346\230\214\345\235\244/\350\213\261\351\233\204\350\201\224\347\233\237\347\214\234\346\213\263\346\270\270\346\210\217/Ad.cs" new file mode 100644 index 0000000000000000000000000000000000000000..890868ee32a5a6dff896d2fc3d6d984a4ea23d4e --- /dev/null +++ "b/\351\237\246\346\230\214\345\235\244/\350\213\261\351\233\204\350\201\224\347\233\237\347\214\234\346\213\263\346\270\270\346\210\217/Ad.cs" @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp14 +{ + class Ad + { + private string name; + + public Ad(string name) + { + this.name = name; + } + + public string Name { get => name; set => name = value; } + + public int Test1() + { + Console.WriteLine("请你选择出拳:1.剪刀 2.石头 3.布"); + int k = int.Parse(Console.ReadLine()); + switch (k) + { + case 1: + Console.WriteLine("{0}出了一个剪刀",name); + break; + case 2: + Console.WriteLine("{0}出了一个石头", name); + break; + case 3: + Console.WriteLine("{0}出了一个布",name); + break; + } + + return k; + } + } +} diff --git "a/\351\237\246\346\230\214\345\235\244/\350\213\261\351\233\204\350\201\224\347\233\237\347\214\234\346\213\263\346\270\270\346\210\217/Judgment.cs" "b/\351\237\246\346\230\214\345\235\244/\350\213\261\351\233\204\350\201\224\347\233\237\347\214\234\346\213\263\346\270\270\346\210\217/Judgment.cs" new file mode 100644 index 0000000000000000000000000000000000000000..51c1f531807f9b3271002118ec7a621421dfea6f --- /dev/null +++ "b/\351\237\246\346\230\214\345\235\244/\350\213\261\351\233\204\350\201\224\347\233\237\347\214\234\346\213\263\346\270\270\346\210\217/Judgment.cs" @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp14 +{ + class Judgment + { + int sum1 = 0; + int sum2 = 0; + int sum3 = 0; + int sum4 = 0; + + public void Date(int p1, int p2) + { + if (p1 - p2 == -2 || p1 - p2 == 1) + { + Console.WriteLine("玩家胜利!"); + sum2++; + } + else if (p1 == p2) + { + Console.WriteLine("平局"); + sum3++; + } + else + { + Console.WriteLine("玩家失败!"); + sum4++; + } + sum1 = sum2 + sum3 + sum4; + + } + + + internal void Date1() + { + Console.WriteLine("你的胜场数:{0}", sum2); + Console.WriteLine("对手胜场数:{0}", sum4); + Console.WriteLine("平局场数:{0}", sum3); + Console.WriteLine("总场数:{0}", sum1); + if (sum2 > sum4) + { + Console.WriteLine("你赢了"); + } + else if (sum2 < sum4) + { + Console.WriteLine("你输了"); + } + else if (sum2 == sum4) + { + Console.WriteLine("平局"); + } + } + } +} \ No newline at end of file diff --git "a/\351\237\246\346\230\214\345\235\244/\350\213\261\351\233\204\350\201\224\347\233\237\347\214\234\346\213\263\346\270\270\346\210\217/Mdf.cs" "b/\351\237\246\346\230\214\345\235\244/\350\213\261\351\233\204\350\201\224\347\233\237\347\214\234\346\213\263\346\270\270\346\210\217/Mdf.cs" new file mode 100644 index 0000000000000000000000000000000000000000..1e5802b63b71fd500014d8a88f9db1fee37596f6 --- /dev/null +++ "b/\351\237\246\346\230\214\345\235\244/\350\213\261\351\233\204\350\201\224\347\233\237\347\214\234\346\213\263\346\270\270\346\210\217/Mdf.cs" @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp14 +{ + class Npc : Ad + { + private string name1; + + public Npc(string name, string name1) : base(name) + { + this.Name1 = name1; + + } + + public string Name1 { get => name1; set => name1 = value; } + + public int MDF1() + { + Random random = new Random(); + int result = random.Next(1, 4); + string str = Convert.ToString(result); + switch (result) + { + case 1: + str = "剪刀"; + break; + case 2: + str = "石头"; + break; + case 3: + str = "布"; + break; + } + Console.WriteLine("{0}出了一个{1}",name1,str); + return result; + } + } +} \ No newline at end of file diff --git "a/\351\237\246\346\230\214\345\235\244/\350\213\261\351\233\204\350\201\224\347\233\237\347\214\234\346\213\263\346\270\270\346\210\217/Program.cs" "b/\351\237\246\346\230\214\345\235\244/\350\213\261\351\233\204\350\201\224\347\233\237\347\214\234\346\213\263\346\270\270\346\210\217/Program.cs" new file mode 100644 index 0000000000000000000000000000000000000000..557a788d302be946eb9bf99660f1efcc6ed58a8a --- /dev/null +++ "b/\351\237\246\346\230\214\345\235\244/\350\213\261\351\233\204\350\201\224\347\233\237\347\214\234\346\213\263\346\270\270\346\210\217/Program.cs" @@ -0,0 +1,98 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp14 +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("---------------欢 迎 进 入 英 雄 联 盟 猜 拳 游 戏--------------"); + Console.WriteLine(); + Console.WriteLine("*********************猜拳开始***********************"); + Console.WriteLine(); + Console.WriteLine("出拳规则:1.剪刀 2.石头 3.布"); + Console.WriteLine("请输入你的名字"); + string name = Console.ReadLine(); + Me me = new Me(name); + + Judgment judgment = new Judgment(); + Console.WriteLine("请选择你对战的角色:1.迪莫 2.小法 3.亚索"); + int a = int.Parse(Console.ReadLine()); + string str = Convert.ToString(a); + switch (str) + { + case "1": + str = "迪莫"; + break; + case "2": + str = "小法"; + break; + case "3": + str = "亚索"; + break; + default: + break; + } + + Mdf mdf = new Mdf(name,str); + switch (a) + { + case 1: + Console.WriteLine("{0} vs 迪莫", name); + dong(ad,mdf,judgment); + break; + case 2: + Console.WriteLine("{0} vs 小法", name); + dong(ad, mdf, judgment); + break; + case 3: + Console.WriteLine("{0} vs 亚索", name); + dong(ad, mdf, judgment); + break; + default: + break; + + } + + } + public static void dong(Ad ad,Mdf mdf,Judgment judgment) + { + + Console.WriteLine("游戏开始吗?"); + string str = Console.ReadLine(); + switch (str) + { + case "y": + dong2(ad, mdf, judgment); + break; + case "n": + + break; + } + } + public static void dong2(Ad ad, Mdf mdf, Judgment judgment) { + while (true) + { + int p1 = ad.Test1(); + int p2 = mdf.NPC1(); + judgment.Date(p1,p2); + Console.WriteLine("是否进行下一轮?"); + string str = Console.ReadLine(); + switch (str) + { + case "y": + dong2(ad, mdf, judgment); + break; + case "n": + judgment.Date1(); + break; + } + break; + } + } + } + }