fast-astar
fast-astar is an implementation of a* algorithm using javascript. Small and fast.
Use
Install fast-astar using npm or introduce Grid.js and Astar.js on the page
Install:
npm install fast-astar --save
Install:
; // Create a gridlet grid = col:11 // col row:7 // row { // Optional, this method is triggered when the grid point changes // console.log(this); } ; // Add obstacles to the grid525354; // Pass the grid as a parameter to the Astar objectlet astar = grid path = astar; console; // [[2,3],[3,2],[4,1],[5,1],[6,1],[7,2],[8,3]]
Demo
Related
License
MIT