Sh3ll
OdayForums


Server : LiteSpeed
System : Linux premium163.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User : infihsqw ( 644)
PHP Version : 8.1.29
Disable Function : NONE
Directory :  /lib64/python3.8/turtledemo/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python3.8/turtledemo/__pycache__/tree.cpython-38.pyc
U

e5dx�@sXdZddlmZmZddlmZdd�Zdd�Zdd	�Z	e
d
krTe	�Zee�e�dS)a�      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.
�)�Turtle�mainloop)�perf_counterccsr|dkrng}|D]>}|�|�|��}|�|�|�|�|�|�|�|�qt|||||�D]
}dVqbdS)z� 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.�N)�forwardZclone�left�right�append�tree)Zplist�l�a�fZlst�p�q�x�r�'/usr/lib64/python3.8/turtledemo/tree.pyr
s



r
cCstt�}|�d�|��|�d�|���dd�|�d�|��|�d�|�	�t
|gddd�}|D]}qjdS)Nr��Zi.������Agffffff�?)rZ
setundobufferZ
hideturtleZspeedZ	getscreenZtracerrZpenuprZpendownr
)r�trrrr�maketree's



rcCst�}t�t�}d||S)Nzdone: %.2f sec.)�clockr)r�brrr�main5sr�__main__N)
�__doc__Zturtlerr�timerrr
rr�__name__�msg�printrrrr�<module>s

ZeroDay Forums Mini