Your IP : 216.73.216.196


Current Path : /opt/alt/python37/lib64/python3.7/turtledemo/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/turtledemo/__pycache__/penrose.cpython-37.opt-1.pyc

B

� fp
�@s�dZddlTddlmZmZddlmZmZdZ	deded�Z
d	d
�Zdd�Zd
d�Z
dd�Zd&dd�Zdd�Zdd�Zdd�Zdd�Zddeddfdd�Zefd d!�Zd"d#�Zed$kr�e�Ze�d%S)'a�       xturtle-example-suite:

          xtx_kites_and_darts.py

Constructs two aperiodic penrose-tilings,
consisting of kites and darts, by the method
of inflation in six steps.

Starting points are the patterns "sun"
consisting of five kites and "star"
consisting of five darts.

For more information see:
 http://en.wikipedia.org/wiki/Penrose_tiling
 -------------------------------------------
�)�*)�cos�pi)�perf_counter�sleepgP�/7���?���
cCsTt|}td�t|�td�t|�td�t|�td�t|�td�dS)N�$�l�)�f�lt�fd�rt)�l�fl�r�7/opt/alt/python37/lib64/python3.7/turtledemo/penrose.py�kitesrcCsTt|}td�t|�td�t|�td�t|�td�t|�td�dS)Nr
r)r
rrr)rrrrr�dart%srcCs�|dkrFt�\}}tt��t|d�t|d�}}}dt|||f<dSt|}td�t||d�t|�t	d�t
||d�td�t|t�t	d�t
||d�td�t|�t	d	�t||d�td�dS)
NrrTr
�r���)�pos�int�heading�round�tiledictr
r�inflatedartrr�inflatekite�d)r�n�px�py�h�x�yrrrrr!1s(
"r!cCs�|dkrFt�\}}tt��t|d�t|d�}}}dt|||f<dSt|}t||d�td�t|�t	d�t
||d�td�t|t�t	d�t
||d�t|�t	d	�dS)
NrrFrr
r�6�~r)rrrrrr
r!rrrr r")rr#r$r%r&r'r(rrrrr Gs"
"r cCs�t�|t|}t|d|d|�x\tD]T}|\}}}t||�t|�t|rhtd�tdd�ntd�tdd�t�q,WdS)NgY@r�black)rg�?rr)g�?rr)	�clearr
Z	shapesizerZsetpos�
setheading�shapeZcolorZstamp)rr#�th�kr&r'r(rrr�drawZs



r1cCs(x"td�D]}t||�td�q
WdS)N��H)�ranger!r)rr#�irrr�sunjs
r6cCs(x"td�D]}t||�td�q
WdS)Nr2r3)r4r r)rr#r5rrr�staros
r7cCsTtd�t�td�t�tdt��t�td�t�tdt��td�dS)Nr�drrr)�tracerZ
begin_polyrZend_polyZregister_shapeZget_polyrrrrr�
makeshapestsr:cCs$t�t�t�t�td�dS)N�user)�resetZhtZpur:Z
resizemoderrrr�start�s
r=���)rrc
Cs�t|�td�iat�}td�|||�t�}t|||�td�t�}tdd�tD��}tdd�tD��}	td||	||	f�dS)NrrcSsg|]}t|r|�qSr)r)�.0r'rrr�
<listcomp>�sztest.<locals>.<listcomp>cSsg|]}t|s|�qSr)r)r@r'rrrrA�sz"%d kites and %d darts = %d pieces.)�gotor-r�clockr9r1�len�print)
rr#�fun�startposr/�a�b�cZnkZndrrr�test�s
rKcCsPt�xDtd�D]8}t�}td||�t�}||}|dkrtd|�qWdS)N�i,r)r=r4rCrKr)rFr5rHrI�trrr�demo�srNcCsjtd�tddd�tt�td�tt�td�tdd�tddd�td	d
dd�t	d
ddd�dS)NZlogog333333�?rrr+i8���gffffff�?rzPlease wait...�center)zArial Blackr
Zbold)ZalignZfontiXrL)�F�u)rGZDone)
�modeZbgcolorrNr6rr7ZpencolorrB�writerKrrrr�main�s

rT�__main__N)r)�__doc__ZturtleZmathrrZtimerrCrr
r"rrr!r r1r6r7r:r=rKrNrT�__name__�msgZmainlooprrrr�<module>s(