ModelingDebug/MinLong/Zhangaiwu.cs

59 lines
1.7 KiB
C#
Raw Normal View History

2024-08-29 01:05:13 +00:00
using System.Diagnostics;
2024-08-25 23:58:04 +00:00
namespace Debug.MinLong;
#pragma warning disable CS8981 // 该类型名称仅包含小写 ascii 字符。此类名称可能会成为该语言的保留值。
public class Zhangaiwu
{
2024-08-28 04:19:44 +00:00
private static int SleepTime = 100;
2024-08-29 01:05:13 +00:00
public static void Newshitou(Main.XiaoLong xiaoLong)
2024-08-25 23:58:04 +00:00
{
var y = Program.chars.GetLength(0);
var x = Program.chars.GetLength(1);
var shitou = new Shitou
{
x = x - 1,
y = y - 1
};
2024-08-28 04:19:44 +00:00
bool isjiafeng = false;//是否加分
2024-08-25 23:58:04 +00:00
for (int i = 1; i < x; i++)
{
2024-08-29 01:05:13 +00:00
// System.Diagnostics.Debug.WriteLine("shitou");
// //测试 自动跳跃
// if (!xiaoLong.istiao && shitou.x == xiaoLong.x + Program.random.Next(1, 2))
// {
// new Thread(() => Main.tiaoyue(xiaoLong)).Start();
// }
2024-08-28 04:19:44 +00:00
if (shitou.x != xiaoLong.x || shitou.y != xiaoLong.y)
{
Program.chars[shitou.y, shitou.x].Char = '0';
if (shitou.x < xiaoLong.x && !isjiafeng)
{
isjiafeng = true;
xiaoLong.score++;
2024-08-29 01:05:13 +00:00
if (SleepTime > 20) SleepTime--;
2024-08-28 04:19:44 +00:00
}
}
else
{
Program.IsWhile = false;
}
Thread.Sleep(SleepTime);
2024-08-29 01:05:13 +00:00
if (shitou.x == xiaoLong.x && shitou.y == xiaoLong.y)
{
Program.IsWhile = false;
}
2024-08-25 23:58:04 +00:00
Program.chars[shitou.y, shitou.x].Char = Program.ShowChar;
2024-08-28 04:19:44 +00:00
--shitou.x;
2024-08-25 23:58:04 +00:00
}
}
public class Shitou
{
public int x;
public int y;
public char Char = '0';
}
}