Added furth UI behavior tweaks, removed a script and moved the p5.min.js into the repo.

This commit is contained in:
2020-05-19 14:29:10 -05:00
parent dc292305fb
commit 163c028145
4 changed files with 34 additions and 6 deletions
+11
View File
@@ -2,6 +2,9 @@ class MazeSolver {
constructor(startingCell, targetCell, searchedColor = [210, 180, 140], finalPathColor = [173, 216, 230]){
this.frontier = [];
this.explored = [];
this.startingCellColor = [255, 0, 0];
this.endingCellColor = [0, 0, 255];
this.finalPathColor = finalPathColor;
this.targetCell = targetCell;
this.startingCell = startingCell;
@@ -20,8 +23,16 @@ class MazeSolver {
highlightFinalPath(maze){
let tmp = this.explored.pop();
tmp.color = this.endingCellColor;
tmp = tmp.parent;
while(tmp != undefined){
tmp.color = this.finalPathColor;
if(tmp.parent == undefined)
tmp.color = this.startingCellColor;
tmp = tmp.parent;
}