Made A Star Algorithm

Made an a* algorithm to calculate a path from a to b, however an
infinite loop seems to crash the system.
First cause : Heuristics