
   ОY쩺                   p    S r SSKJrJr  SSKJr  S rS rS r	\
S:X  a  \	" 5       r\" \5        \" 5         gg)	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              #   .  #    US:  a  / nU  Hh  nUR                  U5        UR                  5       nUR                  U5        UR                  U5        UR	                  U5        UR	                  U5        Mj     [        XAU-  X#5       H  nSv   M	     gg7f)zplist 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/lib/python3.13/turtledemo/tree.pyr   r      s      	1uAIIaL	AFF1IGGAJJJqMJJqM  cQ3%AJ & s   BBc                  p   [        5       n U R                  S 5        U R                  5         U R                  S5        U R	                  5       R                  SS5        U R                  S5        U R                  5         U R                  S5        U R                  5         [        U /SSS5      nU H  nM     g )Nr      Z   i.   A   gffffff?)r   setundobuffer
hideturtlespeed	getscreentracerr
   penupr   pendownr   )r   tr   s      r   maketreer$   '   s    AOODLLNGGAJKKMAFF2JGGIIIdOIIKaS#r6"A     c                  L    [        5       n [        5         [        5       nSX-
  -  $ )Nzdone: %.2f sec.)clockr$   )r   bs     r   mainr)   5   s"    gAJgA$$r%   __main__N)__doc__turtler   r   timer   r'   r   r$   r)   __name__msgprint r%   r   <module>r2      sC     $ &$% z
&C	#JJ r%   