From 205a28eb562efbd3f097a573f893274cbf25176a Mon Sep 17 00:00:00 2001 From: Snowykami <79104275+snowykami@users.noreply.github.com> Date: Fri, 29 Mar 2024 07:03:09 +0800 Subject: [PATCH 1/3] fix: index out of list --- liteyuki/plugins/liteyuki_minigame/game.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liteyuki/plugins/liteyuki_minigame/game.py b/liteyuki/plugins/liteyuki_minigame/game.py index 87b14df7..01ded29f 100644 --- a/liteyuki/plugins/liteyuki_minigame/game.py +++ b/liteyuki/plugins/liteyuki_minigame/game.py @@ -13,7 +13,7 @@ class Dot(BaseModel): class Minesweeper: # 0-8: number of mines around, 9: mine, -1: undefined - NUMS = "⓪①②③④⑤⑥⑦⑧🅑" + NUMS = "⓪①②③④⑤⑥⑦⑧🅑⑩⑪⑫⑬⑭⑮⑯⑰⑱⑲⑳" MASK = "🅜" FLAG = "🅕" MINE = "🅑" From 6a49a70481d53aac37a806892bb4503c7ae959c7 Mon Sep 17 00:00:00 2001 From: Snowykami <79104275+snowykami@users.noreply.github.com> Date: Fri, 29 Mar 2024 07:05:53 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E6=89=AB=E9=9B=B7=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- liteyuki/plugins/liteyuki_minigame/game.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/liteyuki/plugins/liteyuki_minigame/game.py b/liteyuki/plugins/liteyuki_minigame/game.py index 01ded29f..92569877 100644 --- a/liteyuki/plugins/liteyuki_minigame/game.py +++ b/liteyuki/plugins/liteyuki_minigame/game.py @@ -145,14 +145,15 @@ class Minesweeper: Returns: """ dis = " " - text = self.NUMS[0] + dis*2 + start = "> " if self.col >= 10 else "" + text = start + self.NUMS[0] + dis*2 # 横向两个雷之间的间隔字符 # 生成横向索引 for i in range(self.cols): text += f"{self.NUMS[i]}" + dis text += "\n\n" for i, row in enumerate(self.board): - text += f"{self.NUMS[i]}" + dis*2 + text += start + f"{self.NUMS[i]}" + dis*2 print([d.value for d in row]) for dot in row: if dot.mask and not dot.flagged: From 9cf05fd8fd468ba5e5090bf57cea4e9f4fb6ed13 Mon Sep 17 00:00:00 2001 From: Snowykami <79104275+snowykami@users.noreply.github.com> Date: Fri, 29 Mar 2024 07:07:11 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E6=89=AB=E9=9B=B7=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- liteyuki/plugins/liteyuki_minigame/game.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liteyuki/plugins/liteyuki_minigame/game.py b/liteyuki/plugins/liteyuki_minigame/game.py index 92569877..d193b081 100644 --- a/liteyuki/plugins/liteyuki_minigame/game.py +++ b/liteyuki/plugins/liteyuki_minigame/game.py @@ -145,7 +145,7 @@ class Minesweeper: Returns: """ dis = " " - start = "> " if self.col >= 10 else "" + start = "> " if self.cols >= 10 else "" text = start + self.NUMS[0] + dis*2 # 横向两个雷之间的间隔字符 # 生成横向索引