Simple simulation of A* search implemented in Javascript using the canvas