Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
cleaned up some pausing code
  • Loading branch information
AsianPotato authored Mar 28, 2019
commit bb8d2e766551685cb7a3352afd79a2f69f3e3cc3
10 changes: 0 additions & 10 deletions Algorithm-Visualiser.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,7 @@ class algorithmVisualiser{
self.dataSet.swap(j, j-1);
}
while(self.paused)
{
await self.wait(50);
}
await self.wait(self.options.delay); // Delay before next iteration
}
}
Expand Down Expand Up @@ -251,9 +249,7 @@ class algorithmVisualiser{
self.dataSet.swap(partitionIndex + 1, high);
await self.wait(self.options.delay); // Delay before next iteration
while(self.paused)
{
await self.wait(50);
}
partitionIndex++;
// End of Partition

Expand Down Expand Up @@ -282,9 +278,7 @@ class algorithmVisualiser{
}
await self.wait(self.options.delay); // Delay before next iteration
while(self.paused)
{
await self.wait(50);
}
}
self.dataSet.swap(minIdx, i);
}
Expand All @@ -302,9 +296,7 @@ class algorithmVisualiser{
j = j - 1;
await self.wait(self.options.delay);
while(self.paused)
{
await self.wait(50);
}
}
self.dataSet.data[j + 1] = value;
await self.wait(self.options.delay);
Expand Down Expand Up @@ -336,9 +328,7 @@ class algorithmVisualiser{
gapShiftedIndex = currentIndex;
currentIndex -= gap;
while(self.paused)
{
await self.wait(50);
}
}
}

Expand Down