File "tdemo_tree.pyo"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/usr/lib64/python2.7/Demo/turtle/tdemo_tree.pyo
File size: 2.07 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit


Afc@sodZddlmZmZddlmZdZdZdZe	dkrkeZ
e
GHendS(	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|dkrg}x[|D]S}|j||j}|j||j||j||j|qWx)t|||||D]}dVqWndS(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




 cCst}|jd|j|jd|jdd|jd|j|jd|j	t
|gddd}x|D]}qWt|jj
GHdS(NiiiZi.iiAgffffff?(Rt
setundobufferR	t
hideturtletspeedttracerRtpenupRtpendownRtlent	getscreentturtles(RttR((s./usr/lib64/python2.7/Demo/turtle/tdemo_tree.pytmaketree's	







cCs%t}tt}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