Skip to content

Instantly share code, notes, and snippets.

@Parithi
Last active June 6, 2017 13:14
Show Gist options
  • Save Parithi/7f7a4ecb1b16f914b981f135bd1b41c6 to your computer and use it in GitHub Desktop.
Save Parithi/7f7a4ecb1b16f914b981f135bd1b41c6 to your computer and use it in GitHub Desktop.
Get the connecting point on the open list which has the lowest score. Let’s call this point p.
Remove p from the open list and add p to the closed list.
FOR each connecting point q in p’s walkable adjacent points:
IF q is in the closed list: Ignore it.
IF q is not in the open list: Add it and compute its score.
IF q is already in the open list: Check if the f score is lower when we use the current generated path to get there.
If it is, update its score and update its parent as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment