标题: 单人没效果的飞行棋完成,哈哈。。明天再来设置效果。 [打印本页] 作者: 复古。先生 时间: 2014-7-30 23:18 标题: 单人没效果的飞行棋完成,哈哈。。明天再来设置效果。 大神请指点改进方法!
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FeiXingGame
{
class Program
{
static void Main(string[] args)
{
showUI();
#region 令change制0表普通,制1表暂停,制2表轮盘,制3表炸弹
foreach(int i in stop)
{
change[i] = 1;
}
foreach (int i in lucky)
{
change[i] = 2;
}
foreach (int i in guy)
{
change[i] = 3;
}
#endregion
for (int i = 0; i < 100; i++)
{
switch (change[i])
{
case 0:
Console.ForegroundColor = ConsoleColor.White;
game[i] = "□";
break;
case 1:
Console.ForegroundColor = ConsoleColor.Green;
game[i] = "◆";
break;
case 2:
Console.ForegroundColor = ConsoleColor.Blue;
game[i] = "◎";
break;
case 3:
Console.ForegroundColor = ConsoleColor.Red;
game[i] = "☆";
break;
default:
game[i] = "□";
break;
}
if (PosA == i)
{
game[PosA] = "A";
}
if(i<30)
{
Console.Write(game[i]);
}
else if (i == 30)
{
Console.WriteLine();
for (int j = 0; j < 29; j++)
{
Console.Write(" ");
}
Console.WriteLine(game[i]);
}
else if(i<35)
{
for (int j = 0; j < 29; j++)
{
Console.Write(" ");
}
Console.WriteLine(game[i]);
}
else if (i < 65)
{
if (i == 64)
{
for (int q = 64; q>34;q--)
{
#region 判断颜色
switch (change[q])
{
case 0:
Console.ForegroundColor = ConsoleColor.White;
break;
case 1:
Console.ForegroundColor = ConsoleColor.Green;
break;
case 2:
Console.ForegroundColor = ConsoleColor.Blue;
break;
case 3:
Console.ForegroundColor = ConsoleColor.Red;
break;
default:
break;
}
#endregion
Console.Write(game[q]);
}
}
}
else if (i == 65)
{
Console.WriteLine();
Console.WriteLine(game[i]);
}
else if (i < 70)
{
Console.WriteLine(game[i]);
}
else if (i < 100)
{
if (i == 99)
Console.WriteLine(game[i]);
else
Console.Write(game[i]);
}
}
/* Console.WriteLine();
for (int i = 30; i < 35; i++)
{
for (int j = 0; j < 29; j++)
{
Console.Write(" ");
}
Console.WriteLine(game[i]);
}
for (int i = 64; i > 34; i--)
{
Console.Write(game[i]);
}
Console.WriteLine();
for (int i = 65; i < 70; i++)
{
Console.WriteLine(game[i]);
}
for (int i = 70; i < 100; i++)
{
Console.Write(game[i]);
}
*/
}
}
}