Skip to content

Instantly share code, notes, and snippets.

@Nicholas-Swift
Nicholas-Swift / astar.py
Last active November 1, 2024 11:04
A* pathfinding algorithm. Please see comments below for a fork of this gist that includes bug fixes!
class Node():
"""A node class for A* Pathfinding"""
def __init__(self, parent=None, position=None):
self.parent = parent
self.position = position
self.g = 0
self.h = 0