Skip to content

Commit 3a6a734

Browse files
author
MannyC
committed
function formatting
1 parent 1e39663 commit 3a6a734

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

astar.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ var astar = {
6363

6464
start.h = heuristic(start.pos, end.pos, costStraight, costDiagonal);
6565

66-
function pathTo( node ){
66+
function pathTo(node){
6767
var curr = node;
6868
var path = [];
6969
while(curr.parent) {
@@ -83,7 +83,7 @@ var astar = {
8383

8484
// End case -- result has been found, return the traced path.
8585
if(currentNode === end) {
86-
return pathTo( currentNode );
86+
return pathTo(currentNode);
8787
}
8888

8989
// Normal case -- move currentNode from open to closed, process each of its neighbors.
@@ -114,7 +114,7 @@ var astar = {
114114
neighbor.g = gScore;
115115
neighbor.f = neighbor.g + neighbor.h;
116116

117-
if( closest ){
117+
if(closest){
118118
// If the neighbour is closer than the current closestNode or if it's equally close but has
119119
// a cheaper path than the current closest node then it becomes the closest node
120120
if(neighbor.h < closestNode.h || (neighbor.h === closestNode.h && neighbor.g < closestNode.g)){
@@ -238,7 +238,7 @@ Graph.prototype.toString = function() {
238238
return graphString;
239239
};
240240

241-
function GraphNode(x,y,type) {
241+
function GraphNode(x, y, type) {
242242
this.data = { };
243243
this.x = x;
244244
this.y = y;

0 commit comments

Comments
 (0)