mirror of
https://github.com/Xevion/processing-projects.git
synced 2025-12-06 07:15:57 -06:00
gifs for sorting sketches
This commit is contained in:
BIN
sorting/CocktailShaker.gif
Normal file
BIN
sorting/CocktailShaker.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.7 MiB |
BIN
sorting/ColorSort.gif
Normal file
BIN
sorting/ColorSort.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 MiB |
@@ -1,7 +1,7 @@
|
|||||||
import colorsys, random
|
import colorsys, random
|
||||||
|
|
||||||
def setup():
|
def setup():
|
||||||
size(360 * 2, 360 * 2)
|
size(180 * 2, 180 * 2)
|
||||||
global array, carray
|
global array, carray
|
||||||
frameRate(1000)
|
frameRate(1000)
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ Sketches that visualize sorting algorithms as they progress.
|
|||||||
|
|
||||||
- **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.
|

|
||||||
|
|
||||||
- **ColorSort** - Spherical rainbow sorted using simple Bubblesort (?) algorithm. Probably the sketch I am most proud of in the sorting category, as the sphere representation was difficult to create ande model.
|
- **ColorSort** - Circular rainbow sorted using simple Bubblesort (?) algorithm. Probably the sketch I am most proud of in the sorting category, as the sphere representation was difficult to create ande model.
|
||||||
|
|
||||||
|

|
||||||
@@ -1,8 +0,0 @@
|
|||||||
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(
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
mode=Python
|
|
||||||
mode.id=jycessing.mode.PythonMode
|
|
||||||
Reference in New Issue
Block a user