Sindbad~EG File Manager
�
&Μgy � �n � d Z ddlmZmZ ddlmZ d� Zd� Zd� Z e
dk( r e � Z ee� e� yy) 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_counterc # �( K � |dkD r�g }| D ]g }|j |� |j � }|j |� |j |� |j |� |j |� �i t |||z ||� D ] }d�� � yy�w)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)�forward�clone�left�right�append�tree)�plist�l�a�f�lst�p�q�xs �,/usr/local/lib/python3.12/turtledemo/tree.pyr
r
s� � �� � �1�u����A�
�I�I�a�L���� �A�
�F�F�1�I�
�G�G�A�J��J�J�q�M��J�J�q�M�
� �c�1�Q�3��1�%�A��J� &�
�s �BBc �l � t � } | j d � | j � | j d� | j � j dd� | j
d� | j � | j d� | j � t | gddd� }|D ] }� y )Nr � �Z i.����� �A gffffff�?)r �
setundobuffer�
hideturtle�speed� getscreen�tracerr
�penupr �pendownr
)r �tr s r �maketreer$ '