Skip to content

Commit

Permalink
Adjust speeds
Browse files Browse the repository at this point in the history
  • Loading branch information
Lennard Schober committed May 6, 2024
1 parent b79ee0f commit 35ef72c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/scripts2.js
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ async function drawShortestPath(parent, endCell) {
// sum up the path length
pathLength += (weightGrid && weightGrid[cell[0]][cell[1]] == CellState.WEIGHT) ? 5 : 1;
drawGrid();
await sleep(globalSpeed * 50);
await sleep(globalSpeed * 20);
if (gottaStop) return;
}
globalGrid[tRow][tCol] = CellState.PATH;
Expand Down Expand Up @@ -1254,7 +1254,7 @@ async function DFS(startRow, startCol) {
globalGrid[startRow][startCol] = CellState.VISITED;
animationGrid[startRow][startCol] = 2;
drawGrid();
await sleep(globalSpeed * 10);
await sleep(globalSpeed * 5);
if (gottaStop) return;

while (stack.length > 0) {
Expand All @@ -1278,7 +1278,7 @@ async function DFS(startRow, startCol) {
}
globalGrid[newRow][newCol] = CellState.VISITED;
drawGrid();
await sleep(globalSpeed * 10);
await sleep(globalSpeed * 5);
if (gottaStop) return;
}
}
Expand Down

0 comments on commit 35ef72c

Please sign in to comment.