Skip to content
Snippets Groups Projects
Commit 60f10344 authored by Xuan Trinh's avatar Xuan Trinh
Browse files

fix bug

parent 2fe7492b
No related merge requests found
No preview for this file type
No preview for this file type
...@@ -323,5 +323,5 @@ def distance_between(piece: Tuple[int, int], target: Tuple[int, int]) -> bool: ...@@ -323,5 +323,5 @@ def distance_between(piece: Tuple[int, int], target: Tuple[int, int]) -> bool:
dx = abs(piece[1] - target[1]) dx = abs(piece[1] - target[1])
dy = abs(piece[0] - target[0]) dy = abs(piece[0] - target[0])
result = dx + max(0, (dy - dx) / 2) result = dy + max(0, (dx - dy) / 2)
return result return result
from search.movement_logic import distance_between
print(distance_between((-3, 1), (1, 0)))
print(distance_between((-3, 1), (0, -1)))
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment