o
    JAfQ  ã                   @   s\   d Z ddlmZmZmZ ddlmZmZ dd„ Z	dd„ Z
edkr,e
ƒ Zeeƒ eƒ  d	S d	S )
aF        turtle-example-suite:

          tdemo_wikipedia3.py

This example is
inspired by the Wikipedia article on turtle
graphics. (See example wikipedia1 for URLs)

First we create (ne-1) (i.e. 35 in this
example) copies of our first turtle p.
Then we let them perform their steps in
parallel.

Followed by a complete undo().
é    )ÚScreenÚTurtleÚmainloop)Úperf_counterÚsleepc                 C   s˜   | g}t d|ƒD ]}|  ¡ }| d| ¡ | |¡ |} qt |ƒD ](}t|d | ƒ|d  }|D ]}| d| ¡ | d| d|¡ | |¡ q1q!d S )Né   g     €v@g       @gffffffæ?r   )ÚrangeZcloneZrtÚappendÚabsÚpencolorÚfd)ÚpÚneZszZ
turtlelistÚiÚqÚcÚt© r   ú)/usr/lib/python3.10/turtledemo/rosette.pyÚmn_eck   s   
ýür   c                  C   sÎ   t ƒ } |  d¡ tƒ }| d¡ | ¡  | d¡ | d¡ |  dd¡ tƒ }t	|ddƒ tƒ }|| }t
dƒ tƒ }tdd	„ |  ¡ D ƒƒr\|  ¡ D ]}| ¡  qJtdd	„ |  ¡ D ƒƒsFtƒ }d
|| |  S )NZblackr   Zredé   é$   é   r   c                 s   s    | ]}|  ¡ V  qd S )N)Zundobufferentries)Ú.0r   r   r   r   Ú	<genexpr>7   s   € zmain.<locals>.<genexpr>zruntime: %.3f sec)r   Zbgcolorr   ZspeedZ
hideturtler   ZpensizeZtracerÚclockr   r   ÚanyZturtlesZundo)Úsr   ZatÚetZz1r   r   r   r   Úmain$   s(   




þr   Ú__main__N)Ú__doc__Zturtler   r   r   Útimer   r   r   r   r   Ú__name__ÚmsgÚprintr   r   r   r   Ú<module>   s    
ý