My version of A* Algorithm has been implemented using JavaScript with the help of an animation library p5.js
On screen loads, the code automatically selects the end-point which is identified by a red node. A start-point can be selected by left-clicking on any of the cell in the grid. When there is a start-point then the algorithm runs automatically and gives the shortest-path.
h = sqrt ( (current_cell.x – goal.x)2 +
(current_cell.y – goal.y)2 )
Red - End Node
Green - Path
Dark Green - Travelled Path (Closed)
- Obtascles between paths