using System;
public class Game
{
public static void Main(string[] args)
{
int selection;
Console.WriteLine("Please select Games:1.Guessing game;2.Finger guessing game;3.Flight chess;");
selection = Convert.ToInt32(Console.ReadLine());
switch (selection)
{
case 1:
Console.WriteLine("欢迎进入猜数字游戏!游戏规则:随机产生一个1~100之间的一个数,并由玩家进行猜测。\r\n提示玩家是猜大了还是猜小了或是猜对了。\n Good lucky yo tou!");
while (true)
{
Random rd = new Random();
int result = rd.Next(0, 100);
Console.WriteLine("请请输入一个整数(范围为1~100)");
while (true)
{
int input = int.Parse(Console.ReadLine());
if (input == result)
{
Console.WriteLine("恭喜你,猜对了!");
break;
}
else if (input < result)
Console.WriteLine("猜小了!");
else
Console.WriteLine("猜大了!");
}
Console.WriteLine("是否继续,是请输入Y,否请输入N:");
char C = char.Parse(Console.ReadLine());
if (C == 'N')
break;
}
break;
case 2:
Console.WriteLine("欢迎进入简单的猜拳游戏~这个游戏就是简单地石头剪刀布噢,相信大家都有玩过,祝你玩得开心哟");
Console.WriteLine("1代表石头,2代表剪子,3代表布哦");
int stone1 = 1; //代表石头
int scissors1 = 2; // 代表剪子
int cloth1 = 3; //代表布
System.Random rnd = new System.Random();
string aj = Console.ReadLine();
int nbr = (int)rnd.Next(1, 3); //随机数//
string rnd1 = Convert.ToString(nbr); //将rnd的int转化为string//
string stone = Convert.ToString(stone1); //同上//
string scissors = Convert.ToString(scissors1); //同上//
string cloth = Convert.ToString(cloth1);
if ((rnd1 == stone) && (aj == cloth) || (rnd1 == scissors) && (aj == stone) || (rnd1 == cloth) && (aj == scissors))
{
Console.WriteLine("恭喜你!你胜利了!");
}
if ((rnd1 == stone) && (aj == scissors) || (rnd1 == scissors) && (aj == cloth) || (rnd1 == cloth) && (aj == stone))
{
Console.WriteLine("很遗憾!我出局了!");
}
if ((rnd1 == stone) && (aj == stone) || (rnd1 == scissors) && (aj == scissors) || (rnd1 == cloth) && (aj == cloth))
{
Console.WriteLine("再加油噢!是平手!");
}
break;
case 3:
//在数组中 1:幸运轮盘◎
// 2:地雷☆
// 3:暂停▲
// 4:时空隧道卍
// -1:普通棋格□
static int[] mapi = new int[100];
static string[] playername = new string[2];
static int[] playeri = new int[2];
static void Main(string[] args)
{
playeri[0] = 0;
playeri[1] = 0;
装饰();
名字();
Console.Clear();
装饰();
方块();
棋盘();
playGame();
Console.ReadKey(true);
}
private static void playGame()
{
while (true)
{
for (int i = 0; i < 2; i++)
{
Dice(i);
if (playeri[i] >= 99)
{
Console.WriteLine();
Console.WriteLine("{0}获得胜利,按任意键退出游戏", playername[i]);
return;
}
}
}
}
private static void 名字()
{
Console.WriteLine("请输入玩家1的名字");
playername[0] = Console.ReadLine();
while (playername[0] == "")
{
Console.WriteLine("名字不能为空,请重新输入");
playername[0] = Console.ReadLine();
}
Console.WriteLine("请输入玩家2的名字");
playername[1] = Console.ReadLine();
while (playername[1] == "" || playername[1] == playername[0])
{
if (playername[1] == "")
{
Console.WriteLine("名字不能为空,请重新输入");
}
else
{
Console.WriteLine("名字不能相同,请重新输入");
}
playername[1] = Console.ReadLine();
}
}
private static void 装饰()
{
Console.WriteLine("*****************************************************************");
Console.WriteLine("* *");
Console.WriteLine("* 飞行棋 *");
Console.WriteLine("* *");
Console.WriteLine("*****************************************************************");
Console.WriteLine(" 幸运轮盘◎ 地雷☆ 暂停▲ 时空隧道卍");
public class Game
{
public static void Main(string[] args)
{
int selection;
Console.WriteLine("Please select Games:1.Guessing game;2.Finger guessing game;3.Flight chess;");
selection = Convert.ToInt32(Console.ReadLine());
switch (selection)
{
case 1:
Console.WriteLine("欢迎进入猜数字游戏!游戏规则:随机产生一个1~100之间的一个数,并由玩家进行猜测。\r\n提示玩家是猜大了还是猜小了或是猜对了。\n Good lucky yo tou!");
while (true)
{
Random rd = new Random();
int result = rd.Next(0, 100);
Console.WriteLine("请请输入一个整数(范围为1~100)");
while (true)
{
int input = int.Parse(Console.ReadLine());
if (input == result)
{
Console.WriteLine("恭喜你,猜对了!");
break;
}
else if (input < result)
Console.WriteLine("猜小了!");
else
Console.WriteLine("猜大了!");
}
Console.WriteLine("是否继续,是请输入Y,否请输入N:");
char C = char.Parse(Console.ReadLine());
if (C == 'N')
break;
}
break;
case 2:
Console.WriteLine("欢迎进入简单的猜拳游戏~这个游戏就是简单地石头剪刀布噢,相信大家都有玩过,祝你玩得开心哟");
Console.WriteLine("1代表石头,2代表剪子,3代表布哦");
int stone1 = 1; //代表石头
int scissors1 = 2; // 代表剪子
int cloth1 = 3; //代表布
System.Random rnd = new System.Random();
string aj = Console.ReadLine();
int nbr = (int)rnd.Next(1, 3); //随机数//
string rnd1 = Convert.ToString(nbr); //将rnd的int转化为string//
string stone = Convert.ToString(stone1); //同上//
string scissors = Convert.ToString(scissors1); //同上//
string cloth = Convert.ToString(cloth1);
if ((rnd1 == stone) && (aj == cloth) || (rnd1 == scissors) && (aj == stone) || (rnd1 == cloth) && (aj == scissors))
{
Console.WriteLine("恭喜你!你胜利了!");
}
if ((rnd1 == stone) && (aj == scissors) || (rnd1 == scissors) && (aj == cloth) || (rnd1 == cloth) && (aj == stone))
{
Console.WriteLine("很遗憾!我出局了!");
}
if ((rnd1 == stone) && (aj == stone) || (rnd1 == scissors) && (aj == scissors) || (rnd1 == cloth) && (aj == cloth))
{
Console.WriteLine("再加油噢!是平手!");
}
break;
case 3:
//在数组中 1:幸运轮盘◎
// 2:地雷☆
// 3:暂停▲
// 4:时空隧道卍
// -1:普通棋格□
static int[] mapi = new int[100];
static string[] playername = new string[2];
static int[] playeri = new int[2];
static void Main(string[] args)
{
playeri[0] = 0;
playeri[1] = 0;
装饰();
名字();
Console.Clear();
装饰();
方块();
棋盘();
playGame();
Console.ReadKey(true);
}
private static void playGame()
{
while (true)
{
for (int i = 0; i < 2; i++)
{
Dice(i);
if (playeri[i] >= 99)
{
Console.WriteLine();
Console.WriteLine("{0}获得胜利,按任意键退出游戏", playername[i]);
return;
}
}
}
}
private static void 名字()
{
Console.WriteLine("请输入玩家1的名字");
playername[0] = Console.ReadLine();
while (playername[0] == "")
{
Console.WriteLine("名字不能为空,请重新输入");
playername[0] = Console.ReadLine();
}
Console.WriteLine("请输入玩家2的名字");
playername[1] = Console.ReadLine();
while (playername[1] == "" || playername[1] == playername[0])
{
if (playername[1] == "")
{
Console.WriteLine("名字不能为空,请重新输入");
}
else
{
Console.WriteLine("名字不能相同,请重新输入");
}
playername[1] = Console.ReadLine();
}
}
private static void 装饰()
{
Console.WriteLine("*****************************************************************");
Console.WriteLine("* *");
Console.WriteLine("* 飞行棋 *");
Console.WriteLine("* *");
Console.WriteLine("*****************************************************************");
Console.WriteLine(" 幸运轮盘◎ 地雷☆ 暂停▲ 时空隧道卍");