c#之飞行棋项目源码
namespace 飞行棋1
{
class Program
{
static int[] Maps = new int[100];
static int[] PlayerPos = new int[2];
static string[] PlayerNames = new string[2];
static bool[] Flags = new bool[2];
static void Main(string[] args)
{
GameShow();
#region 输入玩家
Console.WriteLine("请输入玩家A的姓名");
PlayerNames[0] = Console.ReadLine();
while (PlayerNames[0] == "")
{
Console.WriteLine("玩家A的姓名不能为空,请重新输入");
PlayerNames[0] = Console.ReadLine();
}
Console.WriteLine("请输入玩家B的姓名");
PlayerNames[1] = Console.ReadLine();
while (PlayerNames[1] == "" || PlayerNames[1] == PlayerNames[0])
{
if (PlayerNames[1] == "")
Console.WriteLine("玩家B的姓名不能为空,请重新输入");
else
Console.WriteLine("玩家B的姓名不能跟玩家A相同,请重新输入");
PlayerNames[1] = Console.ReadLine();
}
#endregion
Console.Clear();
GameShow();
Console.WriteLine("{0}的士兵用A表示", PlayerNames[0]);
Console.WriteLine("{0}的士兵用B表示", PlayerNames[1]);
InitaiMap();
DrawMap();
while (PlayerPos[1] < 99 && PlayerPos[0] < 99)
{
if (Flags[0] == false)
{
PlayGame(0);
}
else
{
Flags[0] = false;
}
if (Flags[1] == false)
{
PlayGame(1);
}
else
{
Flags[1] = false;
}
}
Console.Clear();
if (PlayerPos[0] > PlayerPos[1])
Console