namespace 飞行棋
{
class Program
{
static int[] Maps = new int[100];
static int[] PlayerPos = new int[2];
static string[] PlayerNames = new string[2];
static bool Flags;
static void Main(string[] args)
{
GameShow();//标题
InitailMap();//特殊事件区域
DrawMap();//画图
#region 接受玩家AB的姓名
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine(“请输入玩家A的姓名”);
PlayerNames[0] = Console.ReadLine();
while (PlayerNames[0] == "")
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("玩家A的姓名不能为空,请重新输入");
PlayerNames[0] = Console.ReadLine();
}
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine("请输入玩家B的姓名");
PlayerNames[1] = Console.ReadLine();
while (PlayerNames[1] == PlayerNames[0] || PlayerNames[1] == "")
{
if (PlayerNames[1] == "")
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("玩家B的姓名不能为空");
PlayerNames[1] = Console.ReadLine();
}
else
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("玩家B的姓名不能与玩家A的姓名相同,请重新输入");
PlayerNames[1] = Console.ReadLine();
}
}
#endregion
Console.Clear();//清屏
GameShow();//标题
Console.WriteLine("玩家{0}用A表示",PlayerNames[0]);
Console.WriteLine("玩家{0}用B表示", PlayerNames[1]);
InitailMap();//特殊事件区域
DrawMap();//画图
while (PlayerPos[0] < 99 && PlayerPos[1] < 99)
{
if (Flags == false)
PlayerNumbe(0);
else
Flags = false;
if(PlayerPos[0]>=99)
{
Console.WriteLine("玩家:{0}胜利了", PlayerNames[0]);
break;
}
if (Flags == false)
P