本帖最后由 申延超 于 2012-11-21 19:31 编辑
- /// <summary>
- /// 此方法用于绘制地图
- /// </summary>
- public static void DrowMap()
- {
- Console.WriteLine(" 图列:◎幸运轮盘 ☆地雷 ▲暂停 卐时空隧道");
- Console.WriteLine(" {0}用A表示,{1}用B表示.....", playNames[0], playNames[1]);
- //绘第一行地图
- Console.Write(" ");
- for (int i = 0; i <= 20; i++)
- {
- GetMapString(i);
- }
- Console.WriteLine();
- //绘2-4行地图
- for (int i = 21; i <= 23; i++)
- {
- Console.Write(" ");
- for (int k = 0; k < 20; k++)
- {
- Console.Write(" ");
- }
- GetMapString(i);
- Console.WriteLine();
- }
- #region 绘第五行
- Console.Write(" ");
- for (int i = 74; i <= 89; i++)
- {
- GetMapString(i);
- }
- for (int i = 0; i < 4; i++)
- {
- Console.Write(" ");
- }
- GetMapString(24);
- Console.WriteLine();
- #endregion
- //绘第6-9行
- Drow6To9(73, 90, 25);
- Drow6To9(72, 91, 26);
- Drow6To9(71, 92, 27);
- Drow6To9(70, 93, 28);
- #region 绘第10行地图
- Console.Write(" ");
- GetMapString(69);
- for (int i = 0; i < 4; i++)
- {
- Console.Write(" ");
- }
- for (int i = 116; i <= 121; i++)
- {
- GetMapString(i);
- }
- for (int i = 0; i < 4; i++)
- {
- Console.Write(" ");
- }
- GetMapString(94);
- for (int i = 0; i < 4; i++)
- {
- Console.Write(" ");
- }
- GetMapString(29);
- Console.WriteLine();
- #endregion
- //绘11-13行地图
- DrowTwelveToFifteen(68, 115, 122, 95, 30);
- DrowTwelveToFifteen(67, 114, 123, 96, 31);
- DrowTwelveToFifteen(66, 113, 124, 97, 32);
- #region 绘14行地图
- Console.Write(" ");
- GetMapString(65);
- for (int i = 0; i < 4; i++)
- {
- Console.Write(" ");
- }
- GetMapString(112);
- for (int i = 0; i < 9; i++)
- {
- Console.Write(" ");
- }
- GetMapString(98);
- for (int i = 0; i < 4; i++)
- {
- Console.Write(" ");
- }
- GetMapString(33);
- Console.WriteLine();
- #endregion
- #region 绘15行地图
- Console.Write(" ");
- GetMapString(64);
- for (int i = 0; i < 4; i++)
- {
- Console.Write(" ");
- }
- GetMapString(111);
- for (int i = 0; i < 9; i++)
- {
- Console.Write(" ");
- }
- GetMapString(99);
- for (int i = 0; i < 4; i++)
- {
- Console.Write(" ");
- }
- GetMapString(34);
- Console.WriteLine();
- #endregion
- #region 绘16行地图
- Console.Write(" ");
- GetMapString(63);
- for (int i = 0; i < 4; i++)
- {
- Console.Write(" ");
- }
- for (int i = 110; i >= 100; i--)
- {
- GetMapString(i);
- }
- for (int i = 0; i < 4; i++)
- {
- Console.Write(" ");
- }
- GetMapString(35);
- Console.WriteLine();
- #endregion
- //绘17-19行地图
- Drow17To19(62, 36);
- Drow17To19(61, 37);
- Drow17To19(60, 38);
- //绘20行地图
- Console.Write(" ");
- for (int i = 59; i >= 39; i--)
- {
- GetMapString(i);
- }
- Console.WriteLine();
- }
- /// <summary>
- /// 此方法用于绘制地图第6-9行
- /// </summary>
- /// <param name="num1"></param>
- /// <param name="num2"></param>
- /// <param name="num3"></param>
- public static void Drow6To9(int num1, int num2, int num3)
- {
- Console.Write(" ");
- GetMapString(num1);
- for (int i = 0; i < 14; i++)
- {
- Console.Write(" ");
- }
- GetMapString(num2);
- for (int i = 0; i < 4; i++)
- {
- Console.Write(" ");
- }
- GetMapString(num3);
- Console.WriteLine();
- }
- /// <summary>
- /// 此方法用于绘制11-13行地图
- /// </summary>
- /// <param name="num1"></param>
- /// <param name="num2"></param>
- /// <param name="num3"></param>
- /// <param name="num4"></param>
- /// <param name="num5"></param>
- public static void DrowTwelveToFifteen(int num1, int num2, int num3, int num4, int num5)
- {
- Console.Write(" ");
- GetMapString(num1);
- for (int i = 0; i < 4; i++)
- {
- Console.Write(" ");
- }
- GetMapString(num2);
- for (int i = 0; i < 4; i++)
- {
- Console.Write(" ");
- }
- GetMapString(num3);
- for (int i = 0; i < 4; i++)
- {
- Console.Write(" ");
- }
- GetMapString(num4);
- for (int i = 0; i < 4; i++)
- {
- Console.Write(" ");
- }
- GetMapString(num5);
- Console.WriteLine();
- }
- /// <summary>
- /// 绘18-21行地图
- /// </summary>
- /// <param name="num1"></param>
- /// <param name="num2"></param>
- public static void Drow17To19(int num1, int num2)
- {
- Console.Write(" ");
- GetMapString(num1);
- for (int i = 0; i < 19; i++)
- {
- Console.Write(" ");
- }
- GetMapString(num2);
- Console.WriteLine();
- }
复制代码
这是以前做的一个飞行棋 地图代码也给贴上了 楼主可以参考下 |