aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar vivax3794 <[email protected]>2019-08-10 02:17:21 +0200
committerGravatar vivax3794 <[email protected]>2019-08-10 02:17:21 +0200
commit93370a5d55909224a2abb3463f5a1ee5657f02c1 (patch)
tree5c8f70f0e8bee59519246be63f3f765b55f844c0
parentadded `.end` command (diff)
fixed issue with winning detection
-rw-r--r--bot/seasons/evergreen/minesweeper.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/bot/seasons/evergreen/minesweeper.py b/bot/seasons/evergreen/minesweeper.py
index e67a043b..241aa81d 100644
--- a/bot/seasons/evergreen/minesweeper.py
+++ b/bot/seasons/evergreen/minesweeper.py
@@ -163,11 +163,17 @@ class Minesweeper(commands.Cog):
self.reveal(reveled, board, x, y)
# check if won
+ break_ = False
for x_ in range(10):
for y_ in range(10):
- if not (reveled[y_][x_] == "hidden" and board[y_][x_] == "bomb"):
- await self.won(ctx)
+ if reveled[y_][x_] == "hidden" and board[y_][x_] != "bomb":
+ break_ = True
break
+ else:
+ await self.won(ctx)
+ break
+ if break_:
+ break
await self.reload_board(ctx)