cocktail shaker sort sketch

This commit is contained in:
Xevion
2019-11-08 14:54:17 -06:00
parent 77c332c260
commit 2922a93965
3 changed files with 13 additions and 1 deletions

View File

@@ -6,4 +6,6 @@ Sketches that visualize sorting algorithms as they progress.
## Sketches
- **cocktail_shaker_line** - Sorting of a line using the cocktail shaker algorithm (double bouble sort I believe). Needs reworking as the colors and movement of the line is not as expected (colors shift, movement doesn't properly correlate).
- **cocktail_shaker_line** - Sorting of a line using the cocktail shaker algorithm (double bouble sort I believe). Needs reworking as the colors and movement of the line is not as expected (colors shift, movement doesn't properly correlate).
- **insertion_sort_line** - Sorting of a line using the insertion sort algorithm.

View File

@@ -0,0 +1,8 @@
def setup():
def draw():
if unsorted:
get = unsorted.pop(0)
for index, num in enumerate(sorted):
if sorted[index] < sorted[index + 1] and sorted[index + 1] >= get:
sorted.append(

View File

@@ -0,0 +1,2 @@
mode=Python
mode.id=jycessing.mode.PythonMode