corrected the mentioned issues
This commit is contained in:
+3
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user