From 24d6917c69ead47bb5310bdead12d36c7e007a5f Mon Sep 17 00:00:00 2001 From: muqing <1966944300@qq.com> Date: Tue, 24 Sep 2024 15:24:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=B0=8F=E9=BE=99=E6=B8=B8?= =?UTF-8?q?=E6=88=8F=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MinLong/Main.cs | 19 +++++++++++++++++-- README.md | 5 ++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/MinLong/Main.cs b/MinLong/Main.cs index b169406..533eebd 100644 --- a/MinLong/Main.cs +++ b/MinLong/Main.cs @@ -40,6 +40,7 @@ public class Main int frameCount = 0; double totalTime = 0; int i; int j; + int p = 0; var a = Program.chars.GetLength(0); var b = Program.chars.GetLength(1); var buffer = new StringBuilder(); @@ -49,6 +50,10 @@ public class Main Console.SetCursorPosition(0, 0);// 设定光标位置 Console.Clear(); buffer.Clear(); + + + xiaoLong.Char = xiaoLong.Char == '웃' ? '유' : '웃'; + Program.chars[xiaoLong.y, xiaoLong.x].Char = xiaoLong.Char; for (i = 0; i < a; i++) { for (j = 0; j < b; j++) @@ -69,7 +74,16 @@ public class Main for (i = 0; i < b; i++) { - buffer.Append('-'); + p = p == i % 2 ? 1 : 0; + if (p == 0) + { + buffer.Append(' '); + } + else + { + + buffer.Append('-'); + } } Console.Write(buffer); Console.ResetColor(); @@ -95,7 +109,7 @@ public class Main public class XiaoLong { - public char Char = 'k';//小龙的形状 + public char Char = '웃';//小龙的形状 public ConsoleColor Color = ConsoleColor.Red;//小龙的颜色 public int x;//小龙X坐标 public int y;//小龙Y坐标 @@ -143,6 +157,7 @@ public class Main { //空格 case ConsoleKey.Spacebar: + case ConsoleKey.PageUp: if (!xiaoLong.istiao) { new Thread(() => tiaoyue(xiaoLong)).Start(); break; } xiaoLong.islong = true; break; diff --git a/README.md b/README.md index 7394b40..3cc8635 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,10 @@ PgUp/W 上选择 PgDn/S 下选择 Enter(回车) 确定执行 - +### 使用 + Visual Studio Code + Visual Studio 2022 + 其他能运行C# Net8.0的程序 ### 方法 var 变量 = new ModeSwitch("string", string[], (a) => {