Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 18.118.252.19
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : tree.cpython-310.pyc
o

_by�@s\dZddlmZmZddlmZdd�Zdd�Zdd	�Z	e
d
kr,e	�Zee�e�dSdS)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_counterccsx�|dkr8g}|D]}|�|�|��}|�|�|�|�|�|�|�|�q	t|||||�D]}dVq2dSdS)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�8/usr/local/python-3.10/lib/python3.10/turtledemo/tree.pyr
s�



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



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