tmscli 0.2.1__tar.gz → 0.2.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -90,18 +90,19 @@ class minesweeper():
|
|
|
90
90
|
board[x][y][3]=True
|
|
91
91
|
for i in range(-1,2):
|
|
92
92
|
for j in range(-1,2):
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
board[x+i][y+j][
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
93
|
+
if x+i>=0 and y+j>=0:
|
|
94
|
+
try:
|
|
95
|
+
if not board[x+i][y+j][3]:
|
|
96
|
+
board[x+i][y+j][0]=True
|
|
97
|
+
board[x+i][y+j][3]=True
|
|
98
|
+
if board[x+i][y+j][2]==0:
|
|
99
|
+
self.richochet(board,(x+i,y+j))
|
|
100
|
+
except:
|
|
101
|
+
continue
|
|
101
102
|
|
|
102
103
|
return board
|
|
103
104
|
|
|
104
|
-
terminal_minesweeper=minesweeper(
|
|
105
|
+
terminal_minesweeper=minesweeper(9,10)
|
|
105
106
|
# terminal_minesweeper.print_board(board)
|
|
106
107
|
def main_loop(board):
|
|
107
108
|
while True:
|
|
@@ -134,12 +135,17 @@ def run():
|
|
|
134
135
|
def print_rules():
|
|
135
136
|
print('''
|
|
136
137
|
Minesweeper is a game where you uncover squares in a minefield, and discover where the mines are
|
|
137
|
-
this version has a
|
|
138
|
+
this version has a 9 x 9 board with 10 mines in it
|
|
138
139
|
commands:
|
|
139
140
|
uc x y = uncovers square (x,y)
|
|
140
141
|
fl x y = flags square (x,y)
|
|
141
142
|
uf x y = unflags square (x,y)
|
|
142
|
-
|
|
143
|
+
y------>
|
|
144
|
+
x
|
|
145
|
+
|
|
|
146
|
+
|
|
|
147
|
+
|
|
|
148
|
+
V
|
|
143
149
|
Aim:
|
|
144
150
|
uncover every square without a mine on it
|
|
145
151
|
|
|
File without changes
|
|
File without changes
|