Browse Source

bug fix: consider STEPPED_MINE as a flagged mine

master
JerryXiao 1 year ago
parent
commit
ce49cf9528
Signed by: Jerry <[email protected]> GPG Key ID: 9D9CE43650FF2BAA
3 changed files with 5 additions and 3 deletions
  1. +1
    -0
      .gitignore
  2. +3
    -2
      mscore.py
  3. +1
    -1
      tgmsbot.py

+ 1
- 0
.gitignore View File

@@ -0,0 +1 @@
tgmsbot.db

+ 3
- 2
mscore.py View File

@@ -96,7 +96,7 @@ class Board():
for x in np.nditer(self.map):
if x <= 8:
unopened += 1
elif x == 19:
elif x in (19, DEAD):
mines_opened += 1
if mines_opened == self.mines:
return True
@@ -110,6 +110,7 @@ class Board():
if not automatic and self.map[row][col] == 9:
self.map[row][col] = DEAD
self.state = 3
return
elif self.map[row][col] == 0:
self.map[row][col] += 10 # open this block
# open other blocks
@@ -122,7 +123,7 @@ class Board():
neighbour_mine_opened = 0
neighbour_unopened = 0
for neighbour in self.__iter_neighbour(row, col, return_rc=False):
if neighbour == 19:
if neighbour in (19, DEAD):
neighbour_mine_opened += 1
if neighbour <= 9:
neighbour_unopened += 1


+ 1
- 1
tgmsbot.py View File

@@ -40,7 +40,7 @@ WIN_TEXT_TEMPLATE = "哇所有奇怪的地方都被你打开啦…好羞羞\n" \
STEP_TEXT_TEMPLATE = "{last_player} 踩到了地雷!\n" \
"时间{time}秒,超时{timeouts}次\n\n" \
"{last_player} {reward}\n\n" \
"生命值:({remain}/{ttl})"
"雷区生命值:({remain}/{ttl})"
LOSE_TEXT_TEMPLATE = "一道火光之后,你就在天上飞了呢…好奇怪喵\n" \
"地图:Op {s_op} / Is {s_is} / 3bv {s_3bv}\n操作总数 {ops_count}\n" \
"统计:\n{ops_list}\n{last_player} 是我们中出的叛徒!\n\n" \


Loading…
Cancel
Save