bug fix: consider STEPPED_MINE as a flagged mine

このコミットが含まれているのは:
JerryXiao 2019-01-15 11:54:47 +08:00
コミット ce49cf9528
署名者: Jerry
GPGキーID: 9D9CE43650FF2BAA
3個のファイルの変更5行の追加3行の削除

1
.gitignore vendored ノーマルファイル
ファイルの表示

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

ファイルの表示

@ -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

ファイルの表示

@ -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" \