Nexus File Manager
v2.0
🏠
Dashboard
⚡
System
🌐
›
opt
›
alt
›
python37
›
lib64
›
python3.7
›
turtledemo
›
__pycache__
Quick:
⬆️ Parent
🌐 Root
🏠 Home
🌍 WWW
📁 Temp
⚙️ Etc
📤 Upload
📁 Create
⚡ WordPress Admin
🔄 Refresh
✏️ tree.cpython-37.opt-1.pyc
← Back
B � f� � @ sX d Z ddlmZmZ ddlmZ dd� Zdd� Zdd � Z e d krTe � Zee� e� dS )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 c sz |dkrvg }xF| D ]>}|� |� |�� }|�|� |�|� |�|� |�|� qW x t||| ||�D ] }dV qhW dS )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 �4/opt/alt/python37/lib64/python3.7/turtledemo/tree.pyr s r c C sx t � } | �d � | �� | �d� | �� �dd� | �d� | �� | �d� | � � t | gddd�}x|D ]}qlW d S )Nr � �Z i.����� �A gffffff�?)r Z setundobufferZ hideturtleZspeedZ getscreenZtracerr Zpenupr Zpendownr )r �tr r r r �maketree'