MCPcopy Create free account
hub / github.com/acm-clan/algorithm-stone / construct

Method construct

animations/quicksort.py:82–109  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

80 self.quick_sort(arr, p+1, high)
81
82 def construct(self):
83 self.scale(1)
84 self.add_sound("bg")
85 # logo
86 self.start_logo()
87
88 # content
89
90 self.init_message("快速排序")
91 self.datas = [13, 19, 5, 12, 8, 7, 4, 21, 6, 11]
92
93 arr = AlgoVector(self, self.datas)
94 arr.to_edge(edge=UP)
95
96 self.play(ShowCreation(arr))
97 self.low_arrow = arr.add_arrow(0)
98 self.low_arrow.set_color(self.rand_color())
99 self.current_arrow = arr.add_arrow(0)
100 self.current_arrow.set_color(self.rand_color())
101
102 self.wait()
103 self.quick_sort(arr, 0, arr.size()-1)
104 #
105 self.show_message("一句话记忆:比锚点小的放左边")
106 self.wait(5)
107
108 self.show_message("完成快速排序,谢谢观看!")
109 self.finish()

Callers

nothing calls this directly

Calls 10

scaleMethod · 0.95
add_arrowMethod · 0.95
quick_sortMethod · 0.95
sizeMethod · 0.95
AlgoVectorClass · 0.85
start_logoMethod · 0.80
init_messageMethod · 0.80
rand_colorMethod · 0.80
finishMethod · 0.80
show_messageMethod · 0.45

Tested by

no test coverage detected