tmscli 0.2.3__tar.gz → 0.2.5__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.
|
@@ -6,7 +6,7 @@ class minesweeper():
|
|
|
6
6
|
['uncovered?','flagged?','display']
|
|
7
7
|
def print_board(self,board):
|
|
8
8
|
|
|
9
|
-
top=' 1 2 3 4 5 6 7 8 9
|
|
9
|
+
top=' 1 2 3 4 5 6 7 8 9'
|
|
10
10
|
print(top)
|
|
11
11
|
for i in range(self.size):
|
|
12
12
|
if i==10:
|
|
@@ -109,6 +109,8 @@ def main_loop(board):
|
|
|
109
109
|
terminal_minesweeper.print_board(board)
|
|
110
110
|
cmd=input()
|
|
111
111
|
cmds=cmd.split()
|
|
112
|
+
if cmds[1]>terminal_minesweeper.size or cmds[1]<0 or cmds[2]>terminal_minesweeper.size or cmds[2]<0:
|
|
113
|
+
print('coordinate out of range, please try again')
|
|
112
114
|
if cmds[0]=='uc':
|
|
113
115
|
if (not board[int(cmds[1])-1][int(cmds[2])-1][0]) and (not board[int(cmds[1])-1][int(cmds[2])-1][1]):
|
|
114
116
|
board[int(cmds[1])-1][int(cmds[2])-1][0]=True
|
|
@@ -126,6 +128,8 @@ def main_loop(board):
|
|
|
126
128
|
board[int(cmds[1])-1][int(cmds[2])-1][0]=False
|
|
127
129
|
else:
|
|
128
130
|
print('already not flagged')
|
|
131
|
+
else:
|
|
132
|
+
print('unrecognised command, please try again')
|
|
129
133
|
terminal_minesweeper.check(board)
|
|
130
134
|
def run():
|
|
131
135
|
mines=terminal_minesweeper.get_mines()
|
|
File without changes
|
|
File without changes
|