Skip to content

Commit b31a9b0

Browse files
committed
Merge branch 'redesign' into develop
2 parents be42b56 + 3df0d5f commit b31a9b0

20 files changed

+322
-178
lines changed

levels/bogo_sort.gd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
"""
22
BOGOSORT
33
4+
45
Generates random permutations until the array is sorted.
56
7+
68
Keep on hitting RIGHT ARROW to CONTINUE and hope for the best!
79
"""
810

levels/bubble_sort.gd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
"""
22
BUBBLE SORT
33
4+
45
Bubble sort iterates through the array and looks at each pair of
56
elements, swapping them if they are out of order. When it has gone
67
through the entire array without swapping a single pair, it has
78
finished. Though simple to understand, bubble sort is hopelessly
89
inefficient on all but the smallest of arrays.
910
11+
1012
If the two highlighted elements are out of order, hit LEFT ARROW to swap
1113
them. Otherwise, hit RIGHT ARROW to continue.
1214
"""

levels/cocktail_sort.gd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
"""
22
COCKTAIL SORT
33
4+
45
Cocktail shaker sort is a variation of bubble sort that
56
alternates going backwards and forwards.
67
8+
79
If the two highlighted elements are out of order, hit LEFT ARROW to swap
810
them. Otherwise, hit RIGHT ARROW to continue.
911
"""

levels/comb_sort.gd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
"""
22
COMB SORT
33
4+
45
Comb sort is a variant of bubble sort that operates on gapped arrays.
56
7+
68
If the two highlighted elements are out of order, hit LEFT ARROW to swap
79
them. Otherwise, hit RIGHT ARROW to continue.
810
"""

levels/comparison_sort.gd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ const EFFECTS = {
1111
}
1212

1313
const DISABLE_TIME = 1.0
14-
var NAME = _get_header().split(" ")[0]
15-
var DESCRIPTION = _get_header().split(" ")[1]
16-
var CONTROLS = _get_header().split(" ")[2]
14+
var NAME = _get_header().split(" ")[0]
15+
var DESCRIPTION = _get_header().split(" ")[1]
16+
var CONTROLS = _get_header().split(" ")[2]
1717

1818
var array: ArrayModel
1919

levels/cycle_sort.gd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
"""
22
CYCLE SORT
33
4+
45
Cycle sort repeatedly counts the number of elements less than the first
56
and swaps it with that index until the smallest element is reached. Then
67
it does this process starting at the next out-of-place element.
78
9+
810
If the highlighted element is less than the pointer, hit LEFT ARROW.
911
Otherwise, hit RIGHT ARROW.
1012
"""

levels/insertion_sort.gd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
"""
22
INSERTION SORT
33
4+
45
Insertion sort goes through the array and inserts each
56
element into its correct position. It is most similar to how most people
67
would sort a deck of cards. It is also slow on large arrays but it is
78
one of the faster quadratic algorithms. It is often used to sort smaller
89
subarrays in hybrid sorting algorithms.
910
11+
1012
Hit LEFT ARROW to swap the two highlighted elements as long as they are
1113
out of order. When this is no longer the case, hit RIGHT ARROW to
1214
advance.

levels/merge_sort.gd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
"""
22
MERGE SORT
33
4+
45
Merge sort is an efficient sorting algorithm that splits the array into
56
single-element chunks. Then it merges each pair of chunks until only one
67
sorted chunk is left by repeatedly choosing the smaller element at the
78
head of each chunk and moving the head back. However, it needs an entire
89
array's worth of auxiliary memory.
910
11+
1012
Press the ARROW KEY corresponding to the side that the smaller
1113
highlighted element is on. If you've reached the end of one side, press
1214
the other side's ARROW KEY.

levels/odd_even_sort.gd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
"""
22
ODD-EVEN SORT
33
4+
45
Odd-even sort is a variant of bubble sort that alternates on elements at
56
odd and even indices.
67
8+
79
If the two highlighted elements are out of order, hit LEFT ARROW to swap
810
them. Otherwise, hit RIGHT ARROW to continue.
911
"""

levels/quick_sort.gd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
QUICKSORT
33
4+
45
Quicksort designates the last element as the pivot and puts everything
56
less than the pivot before it and everything greater after it. This
67
partitioning is done by iterating through the array while keeping track
@@ -9,6 +10,7 @@ less than the pivot is encountered, it is swapped with the pointed
910
element and the pointer moves forward. At the end, the pointer and pivot
1011
are swapped, and the process is repeated on the left and right halves.
1112
13+
1214
If the highlighted element is less than the pivot or the pivot has been
1315
reached, press LEFT ARROW to swap it with the pointer. Otherwise, press
1416
RIGHT ARROW to move on.

0 commit comments

Comments
 (0)