manhattan dist calculation

This commit is contained in:
Hourglass 2023-05-13 01:27:26 +02:00
parent d62779cfe8
commit 335e333eed

View File

@ -58,7 +58,7 @@ def h(state: State, goal: tuple[int, int]):
"""
x1, y1 = state.row, state.column
x2, y2 = goal
return abs(x1 - x2) + abs(y1 + y2)
return abs(x1 - x2) + abs(y1 - y2)
def f(curr_node: Node, goal: tuple[int, int]):