diff --git a/src/search_algoritms/a_star.py b/src/search_algoritms/a_star.py index 9a12b9e..78e80b3 100644 --- a/src/search_algoritms/a_star.py +++ b/src/search_algoritms/a_star.py @@ -31,17 +31,11 @@ def a_star(field: List[List[Tile]], start_x: int, start_y: int, start_direction: neighbour_node == node_in_queue and neighbour_node.cost < node_in_queue.cost ]): node_queue[index[0]] = neighbour_node - node_queue = sorted(node_queue, key=itemgetter(0)) + node_queue.sort() return False, False -def heuristic(a: Tuple[int, int], b: Tuple[int, int]): - (x1, y1) = a - (x2, y2) = b - return abs(x1 - x2) + abs(y1 - y2) - - def nearest_bomb(a: Tuple[int, int], field: List[List[Tile]]): min = 20 min_x = 0