diff --git a/maze-solver.js b/maze-solver.js index 0e84606..a93d107 100644 --- a/maze-solver.js +++ b/maze-solver.js @@ -58,9 +58,11 @@ class DepthFirstSolver extends MazeSolver { this.explored.push(this.currentCell); 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.currentCell.color = this.searchedColor; + + } } } @@ -87,3 +89,11 @@ class BreadthFirstSolver extends MazeSolver { 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. + } +}*/