Skip to content

Instantly share code, notes, and snippets.

@Nicholas-Swift
Nicholas-Swift / astar.py
Last active February 13, 2024 14:34
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