o ­=?h‡ã@s\dZddlmZmZddlmZdd„Zdd„Zdd „Z e d kr,e ƒZ e e ƒeƒd Sd S) 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ú6/opt/alt/python310/lib64/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Ús  ý