U ©Î.e¥ ã @ s¾ d Z ddlT ddlZG dd„ deƒZG dd„ deƒZdd „ Zd d„ Zdd „ Z dd„ Z dd„ Zd%dd„Zdd„ Z dd„ Zdd„ Zdd„ Zdd„ Zdd„ Zd d!„ Zd"Zd#Zed$krºeƒ Zeƒ dS )&aŒ sorting_animation.py A minimal sorting algorithm animation: Sorts a shelf of 10 blocks using insertion sort, selection sort and quicksort. Shelfs are implemented using builtin lists. Blocks are turtles with shape "square", but stretched to rectangles by shapesize() --------------------------------------- To exit press space button --------------------------------------- é )Ú*Nc @ s, e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd S ) ÚBlockc C sF || _ tj| ddd� | ¡ | |d dd¡ | d¡ | ¡ d S )NZsquareF)ÚshapeZvisibleg ø?é Úblack)ÚsizeÚTurtleÚ__init__ZpuÚ shapesizeÚ fillcolorÚst)Úselfr © r ú2/usr/lib64/python3.8/turtledemo/sorting_animate.pyr s zBlock.__init__c C s | d¡ d S )NZred©r ©r r r r Úglow s z Block.glowc C s | d¡ d S )Nr r r r r r Úunglow" s zBlock.unglowc C s d | j¡S )NzBlock size: {0})Úformatr r r r r Ú__repr__% s zBlock.__repr__N)Ú__name__Ú __module__Ú__qualname__r r r r r r r r r s r c @ s<