fred-cook / lad-sweeper

minesweeper clone
MIT License
1 stars 0 forks source link

Recursion error when revealing cells #10

Open fred-cook opened 1 year ago

fred-cook commented 1 year ago

Found a recursion error when testing the cells for resizing, Start and end of the stack trace:

Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\Ferd\AppData\Local\Programs\Python\Python311\Lib\tkinter\__init__.py", line 1948, in __call__ return self.func(*args) ^^^^^^^^^^^^^^^^ File "c:\lad-sweeper\sweeper\gui.py", line 101, in <lambda> buttons[i][j].bind("<Button-1>", lambda _, coord=(i, j): self.on_click(coord)) ^^^^^^^^^^^^^^^^^^^^ File "c:\lad-sweeper\sweeper\gui.py", line 121, in on_click self.reveal_board(coord) # need the coord incase it was a mine ^^^^^^^^^^^^^^^^^^^^^^^^ ... File "c:\lad-sweeper\sweeper\gui.py", line 158, in reveal_board self.on_click((i, j)) File "c:\lad-sweeper\sweeper\gui.py", line 121, in on_click self.reveal_board(coord) # need the coord incase it was a mine ^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\lad-sweeper\sweeper\gui.py", line 158, in reveal_board self.on_click((i, j)) File "c:\lad-sweeper\sweeper\gui.py", line 121, in on_click self.reveal_board(coord) # need the coord incase it was a mine ^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\lad-sweeper\sweeper\gui.py", line 158, in reveal_board self.on_click((i, j)) File "c:\lad-sweeper\sweeper\gui.py", line 121, in on_click self.reveal_board(coord) # need the coord incase it was a mine ^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\lad-sweeper\sweeper\gui.py", line 158, in reveal_board self.on_click((i, j)) File "c:\lad-sweeper\sweeper\gui.py", line 121, in on_click self.reveal_board(coord) # need the coord incase it was a mine ^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\lad-sweeper\sweeper\gui.py", line 158, in reveal_board self.on_click((i, j)) File "c:\lad-sweeper\sweeper\gui.py", line 121, in on_click self.reveal_board(coord) # need the coord incase it was a mine ^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\lad-sweeper\sweeper\gui.py", line 158, in reveal_board self.on_click((i, j)) File "c:\lad-sweeper\sweeper\gui.py", line 121, in on_click self.reveal_board(coord) # need the coord incase it was a mine ^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\lad-sweeper\sweeper\gui.py", line 142, in reveal_board self.new_game_button.config(image=self.images["winning_lad"]) File "C:\Users\Ferd\AppData\Local\Programs\Python\Python311\Lib\tkinter\__init__.py", line 1702, in configure return self._configure('configure', cnf, kw) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Ferd\AppData\Local\Programs\Python\Python311\Lib\tkinter\__init__.py", line 1692, in _configure self.tk.call(_flatten((self._w, cmd)) + self._options(cnf)) File "C:\lad-sweeper\.venv\Lib\site-packages\PIL\ImageTk.py", line 148, in __str__ return str(self.__photo) ^^^^^^^^^^^^^^^^^ RecursionError: maximum recursion depth exceeded while getting the str of an object

Had also noted that some buttons weren't being clicked in the recursion