corrected the mentioned issues

This commit is contained in:
gfuse
2024-01-16 12:44:36 +01:00
parent 05a6ca84f7
commit 7278e00ed1
3 changed files with 11 additions and 9 deletions
+3 -3
View File
@@ -3,8 +3,8 @@ import logging
from graphviz import Digraph, render
class Player(Cell):
def __init__(self) -> None:
super().__init__()
def __init__(self, **kwargs) -> None:
super().__init__(**kwargs)
self.destination = None
self.paths = []
self.depth = 0
@@ -21,7 +21,7 @@ class Player(Cell):
def find_paths(self, destination: tuple = (0, 0)):
self.destination = Cell(pose=destination)
if self.destination.pose[0] < 0 or self.destination.pose[1] > 8 or self.destination.pose[0] < 0 or self.destination.pose[1] > 8:
logging.error("Invalid destination position: it should be between 0 and 8")
logging.error("Invalid destination position: it should be between 0 and 7")
return
while len(self.paths) < 1:
self.depth += 1