Skip to content

Commit

Permalink
Docs: Add type hinting to return of a*
Browse files Browse the repository at this point in the history
  • Loading branch information
SverreNystad committed Dec 16, 2023
1 parent 85abbc4 commit b9ae008
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/a_star.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def is_empty(self):
""" Checks if the frontier is empty """
return len(self.frontier) == 0

def a_star(map: Map, start_pos: list[int, int]=None, goal_pos: list[int, int]=None):
def a_star(map: Map, start_pos: list[int, int]=None, goal_pos: list[int, int]=None) -> list[list[int, int]]:
"""
A* algorithm implementation
Expand Down Expand Up @@ -143,4 +143,4 @@ def a_star_heuristic(current_pos: list[int, int], goal_pos: list[int, int]) -> f
x_distance = abs(current_pos[0] - goal_pos[0])
y_distance = abs(current_pos[1] - goal_pos[1])
return x_distance + y_distance


0 comments on commit b9ae008

Please sign in to comment.