Server IP : 68.65.122.142  /  Your IP : 216.73.216.218
Web Server : LiteSpeed
System : Linux server167.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 : glenirhm ( 1318)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /var/../lib64/python3.8/pydoc_data/../html/../../python2.7/Demo/pysvr/../turtle/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //var/../lib64/python3.8/pydoc_data/../html/../../python2.7/Demo/pysvr/../turtle/tdemo_tree.pyc
�
Afc@sodZddlmZmZddlmZd�Zd�Zd�Ze	dkrke�Z
e
GHe�ndS(	s�      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����(tTurtletmainloop(tclockccs�|dkr�g}x[|D]S}|j|�|j�}|j|�|j|�|j|�|j|�qWx)t|||||�D]}dVq�WndS(s� 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(tforwardtclonetlefttrighttappendttreetNone(tplisttltatftlsttptqtx((s./usr/lib64/python2.7/Demo/turtle/tdemo_tree.pyRs




 cCs�t�}|jd�|j�|jd�|jdd�|jd�|j�|jd�|j	�t
|gddd�}x|D]}q�Wt|j�j
��GHdS(NiiiZi.���i�iAgffffff�?(Rt
setundobufferR	t
hideturtletspeedttracerRtpenupRtpendownRtlent	getscreentturtles(RttR((s./usr/lib64/python2.7/Demo/turtle/tdemo_tree.pytmaketree's	







cCs%t�}t�t�}d||S(Nsdone: %.2f sec.(RR(Rtb((s./usr/lib64/python2.7/Demo/turtle/tdemo_tree.pytmain6s		t__main__N(t__doc__tturtleRRttimeRRRRt__name__tmsg(((s./usr/lib64/python2.7/Demo/turtle/tdemo_tree.pyt<module>s