We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f02e1fe commit 27b9a01Copy full SHA for 27b9a01
astar.js
@@ -3,6 +3,17 @@
3
// Freely distributable under the MIT License.
4
// Implements the astar search algorithm in javascript using a binary heap.
5
6
+
7
+(function(definition) {
8
+ if(typeof exports === 'object') {
9
+ module.exports = definition();
10
+ } else if(typeof define === 'function' && define.amd) {
11
+ define([], definition);
12
+ } else {
13
+ window.astar = definition();
14
+ }
15
+})(function() {
16
17
var astar = {
18
init: function(grid) {
19
for(var x = 0, xl = grid.length; x < xl; x++) {
@@ -151,4 +162,6 @@ var astar = {
151
162
}
152
163
};
153
164
165
+return astar;
154
166
167
+});
0 commit comments