Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<script type='text/javascript' src='astar.js'></script>
<script type='text/javascript'>
var graph = new Graph([
[1,1,1,1],
[0,1,1,0],
[0,0,1,1]
]);
var start = graph.grid[0][0];
var end = graph.grid[1][2];
var result = astar.search(graph, start, end);
// result is an array containing the shortest path
</script>
@Salmanalfa

This comment has been minimized.

Copy link

@Salmanalfa Salmanalfa commented Apr 29, 2012

How can immplement this simple code into html file?

@bgrins

This comment has been minimized.

Copy link
Owner Author

@bgrins bgrins commented May 2, 2012

Check out the demo in the project page: https://github.com/bgrins/javascript-astar/tree/master/demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.