Auto commit

上级 4b31ce32
import random
import time
def draw_dot(level):
print(' ', end=' ')
for i in range(level):
......@@ -128,6 +129,7 @@ while True:
board = new_board(level)
mines = lay_mines(level, level)
draw_board(board,level)
start_time = time.time()
while True:
move = is_valid_move(input('请选择位置:'), level)
if not move: continue
......@@ -136,4 +138,8 @@ while True:
dig_mine(row, column, mines, level)
if is_win(board, mines, level) or is_lose(board, mines, level): break
draw_board(board,level)
if not play_again(): break
\ No newline at end of file
end_time = time.time()
print(f"用时:{end_time-start_time:.2f}秒")
if not play_again():
print("下次再见!")
break
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册