| Server IP : 121.121.20.254 / Your IP : 216.73.217.51 Web Server : Microsoft-IIS/10.0 System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64 User : IUSR ( 0) PHP Version : 8.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Python315/Lib/turtledemo/__pycache__/ |
Upload File : |
R
>lqj� c �� � Q s ] QH3 ] PHs Q Q\2 s Q Q\2 sQ sQ sQ s Q s
Q
sQQ ksQ s
Q
sQ sQ sQ sQ sQ sQsQs\Q6X c \ 2 s\ 2 P! P! )a turtledemo/sorting_animation.py
A minimal sorting algorithm animation:
Sorts a shelf of 10 blocks using insertion
sort, selection sort and quicksort.
Shelves are implemented using builtin lists.
Blocks are turtles with shape "square", but
stretched to rectangles by shapesize()
)�*c �: ` � \ sQ s]s n Q sQ sQ sQ sQsU s P! )�Blockc �� � Vm [ O U Q P
Q5 U O 2 U O UQ* Q]2 U O Q2 U O
2 P! )�square)�shape�visibleg �?�black)�size�Turtle�__init__�pu� shapesize� fillcolor�st)�selfr s &&�/C:\Python315\\Lib\turtledemo\sorting_animate.pyr �Block.__init__ sK � �� �����H�e��<���� ����t�c�z�3��*����w����� � c �* � U O Q 2 P! )�red�r �r s &r �glow�
Block.glow s � ����u�r c �* � U O Q 2 P! )r r r s &r �unglow�Block.unglow s � ����w�r c �: � Q O U O 2 ! )zBlock size: {0})�formatr r s &r �__repr__�Block.__repr__ s � � �'�'�� � �2�2r )r )
�__name__�
__module__�__qualname__�__firstlineno__r r r r �__static_attributes__�__classdictcell__��
__classdict__s @r r r s �� � ��� �3� 3r r c �F ` � \ sQ s]$s n Q sQ sQ sQ sQ sQ s Qs
U sP! )�Shelfc �"