AlkantarClanX12

Your IP : 3.12.73.149


Current Path : /lib64/python3.8/turtledemo/__pycache__/
Upload File :
Current File : //lib64/python3.8/turtledemo/__pycache__/forest.cpython-38.opt-2.pyc

U

e5d��@s�ddlmZmZmZmZddlmZddlmZ	dd�Z
dd�Zdd	�Zddd
�Z
dd�Zdd�Zdd�Zdd�Zdd�Zedkr�e�e�dS)�)�Turtle�	colormode�tracer�mainloop��	randrange)�perf_countercCst||d�S)N�r)�n�r�)/usr/lib64/python3.8/turtledemo/forest.py�	symRandomsr
cs��fdd�|D�S)Ncs,g|]$\}}|t��|dt��f�qS)g)\��(�?)r
)�.0�angle�
sizefactor��	angledist�sizedistrr�
<listcomp>s�
�zrandomize.<locals>.<listcomp>r)�
branchlistrrrrr�	randomizes�rcCs2t|�D]$}|�t|��|�d||�qdS)Ng�?)�range�leftr
Zforward)�tZdistance�partsr�irrr�randomfdsr�
�ccs�|dkr�g}g}tt||��D]�\}	}
|	�||�|	�ddd|td�dd|td�d�|	��t|	|||�dV|
D]<\}}|	�|�|�|	�	��|�t
|
||��|	�|�q�qt||||d||||�D]
}
dVq�dS)Nr����r	)
�list�zipZpensizeZpencolorr
�pendownrr�appendZcloner�right�tree)Ztlist�size�levelZwidthfactorZbranchlistsrrZlstZbrsrrrr�xrrrr(s,�
�r(cCsLtd�|��|�d�|��|�d�|��|�||�|��dS)Nrr�Z)r�resetZspeed�
hideturtlerZpenupZsetposr%)rr+�yrrr�start7s

r0cCs2|��t|dd�t|gd|ddddgg�}|S)N�i0����P皙�����?��-g�G�z�?)r��������?�����g���Q��?�r.r0r(�r*Zpenrrrr�doit1Asr;cCs0|��t|dd�t|gd|dddgg�}|S)Niy���i~����xr3r4r7r9r:rrr�doit2Gsr=cCs2|��t|dd�t|gd|ddddgg�}|S)N�i�����dr3)r5gffffff�?)rg
ףp=
�?)r8r6r9r:rrr�doit3Msr@cCs�t�}|��tdd�tdtdd��}tdtdd��}tdtdd��}t�}d}|||fD]&}z|��Wq\|d7}Yq\Xq\|dkrNq�qNtdd	�t�}d
||S)N�Kr�r	)Zundobuffersize�r�rzruntime: %.2f sec.)rZhtrr;r=r@�clock�__next__)�p�u�sr�aZdone�brrr�mainTs$

rL�__main__N)rr)ZturtlerrrrZrandomr�timerrEr
rrr(r0r;r=r@rL�__name__rrrr�<module>s