We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 56baae5 commit 8d9173bCopy full SHA for 8d9173b
graphs/greedy_best_first.py
@@ -58,8 +58,8 @@ def calculate_heuristic(self) -> float:
58
The heuristic here is the Manhattan Distance
59
Could elaborate to offer more than one choice
60
"""
61
- dy = abs(self.pos_x - self.goal_x)
62
- dx = abs(self.pos_y - self.goal_y)
+ dx = abs(self.pos_x - self.goal_x)
+ dy = abs(self.pos_y - self.goal_y)
63
return dx + dy
64
65
def __lt__(self, other) -> bool:
0 commit comments