Your IP : 216.73.216.213


Current Path : /opt/alt/python33/lib64/python3.3/turtledemo/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/turtledemo/__pycache__/tree.cpython-33.pyo

�
��f�c@s}dZddlmZmZddlmZdd�Zdd�Zdd	�Ze	d
krye�Z
ee
�e�ndS(u�      turtle-example-suite:

             tdemo_tree.py

Displays a 'breadth-first-tree' - in contrast
to the classical Logo tree drawing programs,
which use a depth-first-algorithm.

Uses:
(1) a tree-generator, where the drawing is
quasi the side-effect, whereas the generator
always yields None.
(2) Turtle-cloning: At each branching point the
current pen is cloned. So in the end there
are 1024 turtles.
i(uTurtleumainloop(uclockccs�|dkr�g}x[|D]S}|j|�|j�}|j|�|j|�|j|�|j|�qWx)t|||||�D]}dVq�WndS(u� plist is list of pens
    l is length of branch
    a is half of the angle between 2 branches
    f is factor by which branch is shortened
    from level to level.iN(uforwarducloneulefturightuappendutreeuNone(uplistuluaufulstupuqux((u4/opt/alt/python33/lib64/python3.3/turtledemo/tree.pyutrees




 utreecCs�t�}|jd�|j�|jd�|j�jdd�|jd�|j�|j	d�|j
�t|gddd�}x|D]}q�Wtt
|j�j���dS(	NiiiZi�i�iAgffffff�?i.���(uTurtleu
setundobufferuNoneu
hideturtleuspeedu	getscreenutraceruleftupenupuforwardupendownutreeuprintulenuturtles(uputux((u4/opt/alt/python33/lib64/python3.3/turtledemo/tree.pyumaketree's	







umaketreecCs%t�}t�t�}d||S(Nudone: %.2f sec.(uclockumaketree(uaub((u4/opt/alt/python33/lib64/python3.3/turtledemo/tree.pyumain6s		umainu__main__N(u__doc__uturtleuTurtleumainlooputimeuclockutreeumaketreeumainu__name__umsguprint(((u4/opt/alt/python33/lib64/python3.3/turtledemo/tree.pyu<module>s