tmscli 0.2.6__tar.gz → 0.2.7__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,11 +6,12 @@ class minesweeper():
|
|
|
6
6
|
self.num=num
|
|
7
7
|
['uncovered?','flagged?','display']
|
|
8
8
|
def print_board(self,board):
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
top=(len(str(self.size))+2)*' '
|
|
10
|
+
for i in range(self.size):
|
|
11
|
+
top+=str(i+1)+' '
|
|
12
|
+
print(top[:-1])
|
|
12
13
|
for i in range(self.size):
|
|
13
|
-
if i
|
|
14
|
+
if 100>i>9:
|
|
14
15
|
buffer=str(i+1)+' '
|
|
15
16
|
else:
|
|
16
17
|
buffer=str(i+1)+' '
|
|
@@ -139,9 +140,17 @@ def run():
|
|
|
139
140
|
action='store_true',
|
|
140
141
|
help='gives rules'
|
|
141
142
|
)
|
|
143
|
+
p.add_argument(
|
|
144
|
+
'-s','--size',
|
|
145
|
+
type=int,
|
|
146
|
+
default=9,
|
|
147
|
+
help='set size to x'
|
|
148
|
+
)
|
|
142
149
|
args=p.parse_args()
|
|
143
150
|
if args.rules:
|
|
144
151
|
print_rules()
|
|
152
|
+
if args.size:
|
|
153
|
+
terminal_minesweeper.size=args.size
|
|
145
154
|
mines=terminal_minesweeper.get_mines()
|
|
146
155
|
board=terminal_minesweeper.create_starting_board(mines)
|
|
147
156
|
main_loop(board)
|
|
@@ -164,4 +173,5 @@ Aim:
|
|
|
164
173
|
uncover every square without a mine on it
|
|
165
174
|
|
|
166
175
|
If you step on a mine you lose, the number on the square is how many mines are around it (3 x 3 radius)
|
|
167
|
-
''')
|
|
176
|
+
''')
|
|
177
|
+
run()
|
|
File without changes
|
|
File without changes
|