Change the max_mines formula

This commit is contained in:
filifa 2024-03-19 20:38:20 -05:00
parent c4adddb94b
commit a4bad93a23
1 changed files with 3 additions and 1 deletions

View File

@ -67,7 +67,9 @@ def play_pressed(option_box):
messagebox.showerror("Input Error", "There must be at least one mine") messagebox.showerror("Input Error", "There must be at least one mine")
return return
max_mines = rows * cols - 1 # 9 is subtracted because the player's first click will clear a minimum of
# 9 spaces if not clicked on the board edge
max_mines = rows * cols - 9
if mines > max_mines: if mines > max_mines:
messagebox.showerror("Input Error", messagebox.showerror("Input Error",
"Board is too small for this many mines!") "Board is too small for this many mines!")