Skip to content

Commit 9438b37

Browse files
committed
Add new high score congratulations
Also swap quicksort controls to match bubble sort.
1 parent 6490ffa commit 9438b37

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

levels/quick_sort.gd

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ which it is faster than at the tradeoff of stability.
1515
"""
1616
const CONTROLS = """
1717
If the highlighted element is less than the pivot or the pivot has been
18-
reached, press LEFT ARROW. Otherwise, press RIGHT ARROW.
18+
reached, press RIGHT ARROW. Otherwise, press LEFT ARROW.
1919
"""
2020
const CODE = """
2121
def quicksort(a, low=0, high=len(a) - 1):
@@ -30,8 +30,8 @@ def quicksort(a, low=0, high=len(a) - 1):
3030
quicksort(a, pointer + 1, high)
3131
"""
3232
const ACTIONS = {
33-
"SWAP": "Left",
34-
"CONTINUE": "Right",
33+
"CONTINUE": "Left",
34+
"SWAP": "Right",
3535
}
3636
var _index = 0 # Index of element being compared with pivot
3737
var _pointer = 0 # Boundary between partitions

scripts/play.gd

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ func _on_Level_done():
4343
if GlobalScene.get_param("data_type") != ArrayModel.DATA_TYPES.RANDOM_UNIQUE:
4444
score.text += " (only random unique data counts toward a high score!)"
4545
else:
46+
if time < GlobalScore.get_time(_level.NAME, GlobalScene.get_param("size")):
47+
score.text = "HIGH SCORE! " + score.text
4648
GlobalScore.save_score(_level.NAME, _level.array.size, time)
4749
score.align = Label.ALIGN_RIGHT
4850
score.size_flags_horizontal = Control.SIZE_EXPAND_FILL

0 commit comments

Comments
 (0)