This project demonstrates an application of the A* algorithm in an 8 directional movement system.
A C program that displays randomly generated dungeon configurations and find the shortest path between two point using A* is provided.
Uses the seed 7907
.
The program can be compiled using the Makefile
(compiled with make
) and run with ./program
.
Press Q
to quit.
Press ANY KEY
(other than Q
) for a new dungeon configuration.
The terminal size must be at least 72x24
for the program to run.
Dungeon configurations are generated by randomly placing points and drawing lines of varying sizes between them.
For each dungeon configuration the shortest path between its source and target is found using the A* algorithm in an 8 directional movement system.
An approximation (using integers) of octile distance is used as the heuristic which will never overestimate the actual path cost making it admissible.