Fixed a syntax error.
This commit is contained in:
+11
-1
@@ -58,9 +58,11 @@ class DepthFirstSolver extends MazeSolver {
|
|||||||
this.explored.push(this.currentCell);
|
this.explored.push(this.currentCell);
|
||||||
this.statesExplored++;
|
this.statesExplored++;
|
||||||
|
|
||||||
if(this.currentCell.x == this.targetCell.x && this.currentCell.y == this.targetCell.y)
|
if(this.currentCell.x == this.targetCell.x && this.currentCell.y == this.targetCell.y) {
|
||||||
this.frontier = [];
|
this.frontier = [];
|
||||||
this.currentCell.color = this.searchedColor;
|
this.currentCell.color = this.searchedColor;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,3 +89,11 @@ class BreadthFirstSolver extends MazeSolver {
|
|||||||
this.currentCell.color = this.searchedColor;
|
this.currentCell.color = this.searchedColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
class AStarSolver extends MazeSolver {
|
||||||
|
constructor(startingCell, targetCell, searchedColor = [210, 180, 140], finalPathColor = [173, 216, 230]) {
|
||||||
|
super(staringCell, targetCell, searchedColor, finalPathColor);
|
||||||
|
|
||||||
|
this.
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|||||||
Reference in New Issue
Block a user