B
    v9a  ã               @   s8   d Z ddlT dd„ Zdd„ Zedkr4eeƒ ƒ eƒ  dS )	aF        turtle-example-suite:

         tdemo_round_dance.py

(Needs version 1.1 of the turtle module that
comes with Python 3.1)

Dancing turtles have a compound shape
consisting of a series of triangles of
decreasing size.

Turtles march along a circle while rotating
pairwise in opposite direction, with one
exception. Does that breaking of symmetry
enhance the attractiveness of the example?

Press any key to stop the animation.

Technically: demonstrates use of compound
shapes, transformation of shapes as well as
cloning turtles. The animation is
controlled through update().
é    )Ú*c               C   s   da d S )NF)Úrunning© r   r   ú!/usr/lib/python3.7/round_dance.pyÚstop   s    r   c              C   s˜  t ƒ  tdƒ tdƒ tdƒ d} d}d}d}tdƒ}xPtd	ƒD ]D}t|ƒ tƒ }|| 9 }|| 9 }t| ƒ | 	||d
d| fd¡ q@W t
d|ƒ tdƒ tdƒ tƒ  tddƒ g }xFtdƒD ]:}tdƒ tdƒ tdƒ tƒ  |d dkrÀ| tƒ ¡ qÀW tƒ  dattƒ tƒ  d}xxtr’d}	x>|D ]6}
|
 d¡ |
 d¡ |
 |	¡ |	dkr\dnd}	q,W |dk rˆtdƒ t|ƒ |d9 }tƒ  qW dS )NZgray10FZtriangleg}—R—Œcé?g˜Šy!"@é   é   Zcompoundé
   g      Ð?ZblackZmultitrir   i8ÿÿÿé´   é   éüÿÿÿé   é   Té   g®Gázð?zDONE!)ZclearscreenZbgcolorZtracerÚshapeZShapeÚrangeZ	shapesizeZget_shapepolyZtiltZaddcomponentZregister_shapeZpuZsetposÚfdÚltÚupdateÚappendZcloneÚhomer   Z
onkeypressr   ZlistenÚright)ÚfZphiÚsÚcÚshÚiÚpZdancersÚcsÚtaZdancerr   r   r   Úmain   s^    







r    Ú__main__N)Ú__doc__Zturtler   r    Ú__name__ÚprintZmainloopr   r   r   r   Ú<module>   s   5
