def draw_header(stdscr, game):
"""Draws some info about in the first line."""
if game.is_solved():
text = "Congratulations, You Won!"
elif game.is_lost():
text = "You Lost!"
else:
remaining = game.mines.count(True) - game.flags.count(minesweeper.Flags.Marked)
text = "Remaining Mines: {0}".format(remaining)
stdscr.addstr(0, 0, text, curses.A_REVERSE)
return Rect(0, 0, curses.COLS-1, 1)
评论列表
文章目录