标签:象棋 string length OLE 攻击 key adk console highlight
如题:
var a = new String[8,8];
int h, l;
Console.WriteLine("输入车所在的行(0-7):");
h = int.Parse(Console.ReadLine());
Console.WriteLine("输入车所在的列(0-7):");
l = int.Parse(Console.ReadLine());
for (int i = 0; i < a.GetLength(0); i++)
{
for (int j = 0; j < a.GetLength(1); j++)
{
a[i,j] = "口";
}
}
for (int i = 0; i < a.GetLength(0); i++)
{
for (int j = 0; j < a.GetLength(1); j++)
{
if (i == h || j == l)
{
a[i,j] = "杀";
}
}
}
a[h,l] = "车";
for (int i = 0; i < a.GetLength(0); i++)
{
for (int j = 0; j < a.GetLength(1); j++)
{
Console.Write(a[i,j] + "");
}
Console.WriteLine();
}
Console.ReadKey();
标签:象棋 string length OLE 攻击 key adk console highlight
原文地址:https://www.cnblogs.com/wanjinliu/p/10980820.html