Your IP : 216.73.216.213


Current Path : /opt/alt/python33/lib64/python3.3/turtledemo/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/turtledemo/__pycache__/forest.cpython-33.pyc

�
��f�c@s�dZddlmZmZmZmZddlmZddlm	Z	dd�Z
dd�Zd	d
�Zddd
d�Z
dd�Zdd�Zdd�Zdd�Zdd�Zedkr�e�Zee�e�ndS(uE     turtlegraphics-example-suite:

             tdemo_forest.py

Displays a 'forest' of 3 'breadth-first-trees'
similar to the one from example tree.
For further remarks see xtx_tree.py

This example is a 'breadth-first'-rewrite of
a Logo program written by Erich Neuwirth. See:
http://homepage.univie.ac.at/erich.neuwirth/
i(uTurtleu	colormodeutracerumainloop(u	randrange(uclockcCst||d�S(Ni(u	randrange(un((u6/opt/alt/python33/lib64/python3.3/turtledemo/forest.pyu	symRandomsu	symRandomcs��fdd�|D�S(Ncs:g|]0\}}|t��|dt��f�qS(g)\��(�?(u	symRandom(u.0uangleu
sizefactor(u	angledistusizedist(u6/opt/alt/python33/lib64/python3.3/turtledemo/forest.pyu
<listcomp>s	urandomize.<locals>.<listcomp>((u
branchlistu	angledistusizedist((u	angledistusizedistu6/opt/alt/python33/lib64/python3.3/turtledemo/forest.pyu	randomizesu	randomizecCsCx<t|�D].}|jt|��|jd||�q
WdS(Ng�?(urangeuleftu	symRandomuforward(utudistanceupartsu	angledistui((u6/opt/alt/python33/lib64/python3.3/turtledemo/forest.pyurandomfdsurandomfdi
iccsF|dkrBg}g}x�tt||��D]�\}	}
|	j||�|	jddd|td�dd|td�d�|	j�t|	|||�dVxZ|
D]R\}}|	j|�|j|	j	��|jt
|
||��|	j|�q�Wq.Wx6t||||d||||�D]}
dVq0WndS(Nii�i�iii(ulistuzipupensizeupencoloru	symRandomupendownurandomfduleftuappenducloneu	randomizeurightutreeuNone(utlistusizeuleveluwidthfactorubranchlistsu	angledistusizedistulstubrsutu
branchlistuangleu
sizefactorux((u6/opt/alt/python33/lib64/python3.3/turtledemo/forest.pyutrees&"

utreecCs`td�|j�|jd�|j�|jd�|j�|j||�|j�dS(Ni�iiZ(u	colormodeuresetuspeedu
hideturtleuleftupenupusetposupendown(utuxuy((u6/opt/alt/python33/lib64/python3.3/turtledemo/forest.pyustart7s





ustartc	CsE|j�t|dd
�t|gd|ddddgg�}|S(Nii�iPg�������?i-g�G�z�?ig�������?g���Q��?i0���(i-g�G�z�?(ig�������?i���(i���g���Q��?(u
hideturtleustartutree(ulevelupenut((u6/opt/alt/python33/lib64/python3.3/turtledemo/forest.pyudoit1As
'udoit1cCsB|j�t|dd	�t|gd|dd
dgg�}|S(
Ni�i�ixg�������?i-g�G�z�?g���Q��?iy���i~���(i-g�G�z�?i���(i���g���Q��?(u
hideturtleustartutree(ulevelupenut((u6/opt/alt/python33/lib64/python3.3/turtledemo/forest.pyudoit2Gs
$udoit2c	CsE|j�t|dd
�t|gd|ddddgg�}|S(Ni�iZidg�������?i-gffffff�?ig
ףp=
�?g�������?i����(i-gffffff�?(ig
ףp=
�?i���(i���g�������?(u
hideturtleustartutree(ulevelupenut((u6/opt/alt/python33/lib64/python3.3/turtledemo/forest.pyudoit3Ms
'udoit3c
Cs�t�}|j�tdd�tdtdd��}tdtdd��}tdtdd��}t�}xVd}x:|||fD])}y|j�Wq�|d7}Yq�Xq�W|dkrtPqtqttdd	�t�}d
||S(NiKiiuundobuffersizeiiiii
uruntime: %.2f sec.(uTurtleuhtutracerudoit1udoit2udoit3uclocku__next__(upuuusutuaudoneub((u6/opt/alt/python33/lib64/python3.3/turtledemo/forest.pyumainTs&	

	
	umainu__main__N(u__doc__uturtleuTurtleu	colormodeutracerumainloopurandomu	randrangeutimeuclocku	symRandomu	randomizeurandomfdutreeustartudoit1udoit2udoit3umainu__name__umsguprint(((u6/opt/alt/python33/lib64/python3.3/turtledemo/forest.pyu<module>
s "