From 3205c5c083f58fcbb42aca250d100a7e687cf0cd Mon Sep 17 00:00:00 2001
From: wei-changkun <1810878212@qq.com>
Date: Mon, 7 Jun 2021 20:55:57 +0800
Subject: [PATCH 1/7] first commit
---
.../PersonClass.cs" | 6 +-
.../Program.cs" | 48 +++------
.../Program.cs" | 39 ++++++++
.../PttClass.cs" | 28 ++++++
.../Ad.cs" | 40 ++++++++
.../Judgment.cs" | 58 +++++++++++
.../Mdf.cs" | 42 ++++++++
.../Program.cs" | 98 +++++++++++++++++++
8 files changed, 323 insertions(+), 36 deletions(-)
create mode 100644 "\351\237\246\346\230\214\345\235\244/\347\273\223\346\236\204\344\275\223/Program.cs"
create mode 100644 "\351\237\246\346\230\214\345\235\244/\347\273\223\346\236\204\344\275\223/PttClass.cs"
create mode 100644 "\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"
create mode 100644 "\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"
create mode 100644 "\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"
create mode 100644 "\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"
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"
index 273c08f..f68c583 100644
--- "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"
@@ -6,15 +6,15 @@ using System.Threading.Tasks;
namespace ConsoleApp1
{
- class PersonClass
+ class PttClass
{
private string name;
private long phone;
private string adder;
- public PersonClass()
+ public PttClass()
{ }
- public PersonClass(string name, long phone, string adder)
+ public PttClass(string name, long phone, string adder)
{
this.name = name;
this.phone = phone;
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"
index 11a4d31..5965a00 100644
--- "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"
@@ -6,25 +6,7 @@ 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 struct PttStruct
{
public string name;
public long phone;
@@ -33,25 +15,25 @@ namespace ConsoleApp1
static void Main(string[] args)
{
- PersonStruct p1 = new PersonStruct();
- p1.name = "阿珍";
- p1.phone =13520148521;
- p1.adder = "上海老街";
+ PersonStruct p1 = new PttStruct();
+ p1.name = "啊伟";
+ p1.phone =10086110120;
+ p1.adder = "金三角";
- PersonStruct p2 = new PersonStruct();
+ PersonStruct p2 = new PttStruct();
p2 = p1;
- p2.name = "阿强";
- Console.WriteLine(p1.name);//未改变
+ p2.name = "小蒋";
+ Console.WriteLine(p1.name);
- PersonClass p3 = new PersonClass();
- p3.Name = "阿珍爱上了阿强";
- p3.Phone = 12365485201;
- p3.Adder = "夜上海";
+ PersonClass p3 = new PttClass();
+ p3.Name = "啊伟把小蒋杀了";
+ p3.Phone = 10086110120s;
+ p3.Adder = "金三角";
- PersonClass p4 = new PersonClass();
+ PersonClass p4 = new PttClass();
p4 = p3;
- p4.Name = "阿强爱上了阿珍";
- Console.WriteLine(p3.Name);//改变
+ p4.Name = "啊伟杀了小蒋";
+ Console.WriteLine(p3.Name);
}
}
}
diff --git "a/\351\237\246\346\230\214\345\235\244/\347\273\223\346\236\204\344\275\223/Program.cs" "b/\351\237\246\346\230\214\345\235\244/\347\273\223\346\236\204\344\275\223/Program.cs"
new file mode 100644
index 0000000..180d459
--- /dev/null
+++ "b/\351\237\246\346\230\214\345\235\244/\347\273\223\346\236\204\344\275\223/Program.cs"
@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ConsoleApp1
+{
+ public struct PttStruct
+ {
+ public string name;
+ public long phone;
+ public string adder;
+ }
+ static void Main(string[] args)
+ {
+
+ PersonStruct p1 = new PttStruct();
+ p1.name = "啊伟";
+ p1.phone =10086110120;
+ p1.adder = "金三角";
+
+ PersonStruct p2 = new PttStruct();
+ p2 = p1;
+ p2.name = "小蒋";
+ Console.WriteLine(p1.name);
+
+ PersonClass p3 = new PttClass();
+ p3.Name = "啊伟把小蒋杀了";
+ p3.Phone = 10086110120;
+ p3.Adder = "金三角";
+
+ PersonClass p4 = new PttClass();
+ p4 = p3;
+ p4.Name = "啊伟杀了小蒋";
+ Console.WriteLine(p3.Name);
+ }
+ }
+}
diff --git "a/\351\237\246\346\230\214\345\235\244/\347\273\223\346\236\204\344\275\223/PttClass.cs" "b/\351\237\246\346\230\214\345\235\244/\347\273\223\346\236\204\344\275\223/PttClass.cs"
new file mode 100644
index 0000000..f68c583
--- /dev/null
+++ "b/\351\237\246\346\230\214\345\235\244/\347\273\223\346\236\204\344\275\223/PttClass.cs"
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ConsoleApp1
+{
+ class PttClass
+ {
+ private string name;
+ private long phone;
+ private string adder;
+
+ public PttClass()
+ { }
+ public PttClass(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\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 0000000..b891a05
--- /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 0000000..182875c
--- /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 0000000..4747da1
--- /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 0000000..99c66e6
--- /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;
+ }
+ }
+ }
+ }
--
Gitee
From 256dabe82f9ea933c745fac03851bbfbc77ae0f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=9F=A6=E6=98=8C=E5=9D=A4?= <1810878212@qq.com>
Date: Mon, 7 Jun 2021 22:57:33 +0800
Subject: [PATCH 2/7] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20?=
=?UTF-8?q?=E9=9F=A6=E6=98=8C=E5=9D=A4/=E7=BB=93=E6=9E=84=E4=BD=93?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Program.cs" | 39 -------------------
.../PttClass.cs" | 28 -------------
2 files changed, 67 deletions(-)
delete mode 100644 "\351\237\246\346\230\214\345\235\244/\347\273\223\346\236\204\344\275\223/Program.cs"
delete mode 100644 "\351\237\246\346\230\214\345\235\244/\347\273\223\346\236\204\344\275\223/PttClass.cs"
diff --git "a/\351\237\246\346\230\214\345\235\244/\347\273\223\346\236\204\344\275\223/Program.cs" "b/\351\237\246\346\230\214\345\235\244/\347\273\223\346\236\204\344\275\223/Program.cs"
deleted file mode 100644
index 180d459..0000000
--- "a/\351\237\246\346\230\214\345\235\244/\347\273\223\346\236\204\344\275\223/Program.cs"
+++ /dev/null
@@ -1,39 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace ConsoleApp1
-{
- public struct PttStruct
- {
- public string name;
- public long phone;
- public string adder;
- }
- static void Main(string[] args)
- {
-
- PersonStruct p1 = new PttStruct();
- p1.name = "啊伟";
- p1.phone =10086110120;
- p1.adder = "金三角";
-
- PersonStruct p2 = new PttStruct();
- p2 = p1;
- p2.name = "小蒋";
- Console.WriteLine(p1.name);
-
- PersonClass p3 = new PttClass();
- p3.Name = "啊伟把小蒋杀了";
- p3.Phone = 10086110120;
- p3.Adder = "金三角";
-
- PersonClass p4 = new PttClass();
- p4 = p3;
- p4.Name = "啊伟杀了小蒋";
- Console.WriteLine(p3.Name);
- }
- }
-}
diff --git "a/\351\237\246\346\230\214\345\235\244/\347\273\223\346\236\204\344\275\223/PttClass.cs" "b/\351\237\246\346\230\214\345\235\244/\347\273\223\346\236\204\344\275\223/PttClass.cs"
deleted file mode 100644
index f68c583..0000000
--- "a/\351\237\246\346\230\214\345\235\244/\347\273\223\346\236\204\344\275\223/PttClass.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 PttClass
- {
- private string name;
- private long phone;
- private string adder;
-
- public PttClass()
- { }
- public PttClass(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; }
- }
-}
--
Gitee
From 4ab4c22099d657d6e16e4beb449039da9a2eaf9d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=9F=A6=E6=98=8C=E5=9D=A4?= <1810878212@qq.com>
Date: Mon, 7 Jun 2021 22:59:36 +0800
Subject: [PATCH 3/7] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20?=
=?UTF-8?q?=E9=9F=A6=E6=98=8C=E5=9D=A4/=E8=8B=B1=E9=9B=84=E8=81=94?=
=?UTF-8?q?=E7=9B=9F=E7=8C=9C=E6=8B=B3=E6=B8=B8=E6=88=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Ad.cs" | 40 --------
.../Judgment.cs" | 58 -----------
.../Mdf.cs" | 42 --------
.../Program.cs" | 98 -------------------
4 files changed, 238 deletions(-)
delete mode 100644 "\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"
delete mode 100644 "\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"
delete mode 100644 "\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"
delete mode 100644 "\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"
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"
deleted file mode 100644
index b891a05..0000000
--- "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"
+++ /dev/null
@@ -1,40 +0,0 @@
-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"
deleted file mode 100644
index 182875c..0000000
--- "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"
+++ /dev/null
@@ -1,58 +0,0 @@
-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"
deleted file mode 100644
index 4747da1..0000000
--- "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"
+++ /dev/null
@@ -1,42 +0,0 @@
-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"
deleted file mode 100644
index 99c66e6..0000000
--- "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"
+++ /dev/null
@@ -1,98 +0,0 @@
-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;
- }
- }
- }
- }
--
Gitee
From baa072c15ad8b691bd309fab2f1bb50891ab17e4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=9F=A6=E6=98=8C=E5=9D=A4?= <1810878212@qq.com>
Date: Mon, 7 Jun 2021 23:01:29 +0800
Subject: [PATCH 4/7] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20=E9=9F=A6=E6=98=8C?=
=?UTF-8?q?=E5=9D=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
"\351\237\246\346\230\214\345\235\244/.keep" | 0
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 "\351\237\246\346\230\214\345\235\244/.keep"
diff --git "a/\351\237\246\346\230\214\345\235\244/.keep" "b/\351\237\246\346\230\214\345\235\244/.keep"
new file mode 100644
index 0000000..e69de29
--
Gitee
From 896e23df97523679b3c7a188287a093ffd45fa2a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=9F=A6=E6=98=8C=E5=9D=A4?= <1810878212@qq.com>
Date: Mon, 7 Jun 2021 23:01:48 +0800
Subject: [PATCH 5/7] 1
---
.../Ad.cs" | 40 ++++++++
.../Judgment.cs" | 58 +++++++++++
.../Mdf.cs" | 42 ++++++++
.../Program.cs" | 98 +++++++++++++++++++
4 files changed, 238 insertions(+)
create mode 100644 "\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"
create mode 100644 "\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"
create mode 100644 "\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"
create mode 100644 "\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"
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 0000000..890868e
--- /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 0000000..51c1f53
--- /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 0000000..1e5802b
--- /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 0000000..557a788
--- /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;
+ }
+ }
+ }
+ }
--
Gitee
From d2fefc4546ce6993f492298e36928b6b904b48e7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=9F=A6=E6=98=8C=E5=9D=A4?= <1810878212@qq.com>
Date: Mon, 7 Jun 2021 23:01:56 +0800
Subject: [PATCH 6/7] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20?=
=?UTF-8?q?=E9=9F=A6=E6=98=8C=E5=9D=A4/.keep?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
"\351\237\246\346\230\214\345\235\244/.keep" | 0
1 file changed, 0 insertions(+), 0 deletions(-)
delete mode 100644 "\351\237\246\346\230\214\345\235\244/.keep"
diff --git "a/\351\237\246\346\230\214\345\235\244/.keep" "b/\351\237\246\346\230\214\345\235\244/.keep"
deleted file mode 100644
index e69de29..0000000
--
Gitee
From a97d5f26bf004570b876cc481ba5e4d605db8254 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=9F=A6=E6=98=8C=E5=9D=A4?= <1810878212@qq.com>
Date: Mon, 7 Jun 2021 23:03:25 +0800
Subject: [PATCH 7/7] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20?=
=?UTF-8?q?=E9=83=91=E7=BE=8E=E5=A9=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../\347\214\234\346\213\263/Caipan.cs" | 61 -----
.../\347\214\234\346\213\263/Cc.cs" | 26 --
.../\347\214\234\346\213\263/Computer.cs" | 28 --
.../\347\214\234\346\213\263/Hero.cs" | 34 ---
.../\347\214\234\346\213\263/Liubei.cs" | 27 --
.../\347\214\234\346\213\263/Me.cs" | 13 -
.../\347\214\234\346\213\263/Program.cs" | 246 ------------------
.../\347\214\234\346\213\263/Sunquan.cs" | 28 --
.../PersonClass.cs" | 28 --
.../Program.cs" | 39 ---
10 files changed, 530 deletions(-)
delete mode 100644 "\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Caipan.cs"
delete mode 100644 "\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Cc.cs"
delete mode 100644 "\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Computer.cs"
delete mode 100644 "\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Hero.cs"
delete mode 100644 "\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Liubei.cs"
delete mode 100644 "\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Me.cs"
delete mode 100644 "\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Program.cs"
delete mode 100644 "\351\203\221\347\276\216\345\251\267/\347\214\234\346\213\263/Sunquan.cs"
delete mode 100644 "\351\203\221\347\276\216\345\251\267/\347\273\223\346\236\204\344\275\223/PersonClass.cs"
delete mode 100644 "\351\203\221\347\276\216\345\251\267/\347\273\223\346\236\204\344\275\223/Program.cs"
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 41678d3..0000000
--- "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 f53b9dd..0000000
--- "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 6316148..0000000
--- "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 b77c958..0000000
--- "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 0dd9312..0000000
--- "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 2ae0447..0000000
--- "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 40daa74..0000000
--- "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 7a3a350..0000000
--- "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 f68c583..0000000
--- "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 PttClass
- {
- private string name;
- private long phone;
- private string adder;
-
- public PttClass()
- { }
- public PttClass(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 5965a00..0000000
--- "a/\351\203\221\347\276\216\345\251\267/\347\273\223\346\236\204\344\275\223/Program.cs"
+++ /dev/null
@@ -1,39 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace ConsoleApp1
-{
- public struct PttStruct
- {
- public string name;
- public long phone;
- public string adder;
- }
- static void Main(string[] args)
- {
-
- PersonStruct p1 = new PttStruct();
- p1.name = "啊伟";
- p1.phone =10086110120;
- p1.adder = "金三角";
-
- PersonStruct p2 = new PttStruct();
- p2 = p1;
- p2.name = "小蒋";
- Console.WriteLine(p1.name);
-
- PersonClass p3 = new PttClass();
- p3.Name = "啊伟把小蒋杀了";
- p3.Phone = 10086110120s;
- p3.Adder = "金三角";
-
- PersonClass p4 = new PttClass();
- p4 = p3;
- p4.Name = "啊伟杀了小蒋";
- Console.WriteLine(p3.Name);
- }
- }
-}
--
Gitee