Your IP : 216.73.216.196


Current Path : /opt/alt/python310/lib64/python3.10/turtledemo/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/turtledemo/__pycache__/penrose.cpython-310.opt-1.pyc

o

0�iB
�@s�dZddlTddlmZmZddlmZmZdZ	deded�Z
d	d
�Zdd�Zd
d�Z
dd�Zd&dd�Zdd�Zdd�Zdd�Zdd�Zddeddfdd�Zefd d!�Zd"d#�Zed$krge�Ze�d%Sd%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�9/opt/alt/python310/lib64/python3.10/turtledemo/penrose.py�kite�rcCsTt|}td�t|�td�t|�td�t|�td�t|�td�dS)Nr
rr
rrrr�dart%rrcCs�|dkr#t�\}}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�tiledictrr�inflatedartrr�inflatekite�d�r�nZpx�py�h�x�yrrrrr$1s(
"r$cCs�|dkr#t�\}}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)rrr r!r"rr$rrrr#r%r&rrrr#Gs"
"r#cCs�t�|t|}t|d|d|�tD]*}|\}}}t||�t|�t|r3td�tdd�n	td�tdd�t�qdS)NgY@r�black)r��?rr)r/rr)	�clearrZ	shapesizer"Zsetpos�
setheading�shapeZcolorZstamp)rr'�th�kr)r*r+rrr�drawZs


�r5cC�$td�D]}t||�td�qdS�N��H)�ranger$r�rr'�irrr�sunj�

�r=cCr6r7)r:r#rr;rrr�staror>r?cCsTtd�t�td�t�tdt��t�td�t�tdt��td�dS)Nr�drrr)�tracerZ
begin_polyrZend_polyZregister_shapeZget_polyrrrrr�
makeshapestsrBcCs$t�t�t�t�td�dS)N�user)�resetZhtZpurBZ
resizemoderrrr�start�s
rE���)rrcCsxt|�td�iatd�|||�t|||�td�tdd�tD��}tdd�tD��}td||||f�dS)NrrcSsg|]}t|r|�qSr�r"��.0r*rrr�
<listcomp>��ztest.<locals>.<listcomp>cSsg|]}t|s|�qSrrHrIrrrrK�rLz"%d kites and %d darts = %d pieces.)�gotor1r"rAr5�len�print)rr'�fun�startposr3ZnkZndrrr�test�s
rRcCsLt�td�D]}t�}td||�t�}||}|dkr#td|�qdS)N�i,r)rEr:�clockrRr)rPr<�a�b�trrr�demo�s��rXcCsjtd�tddd�tt�td�tt�td�tdd�tddd�td	d
dd�t	d
ddd�dS)NZlogog333333�?rrr.i8���gffffff�?rzPlease wait...�center)zArial Blackr
Zbold)ZalignZfontiXrS)�F�u)rQZDone)
�modeZbgcolorrXr=rr?ZpencolorrM�writerRrrrr�main�s
�r^�__main__N)r)�__doc__ZturtleZmathrr�timerrTrrr%rrr$r#r5r=r?rBrErRrXr^�__name__�msgZmainlooprrrr�<module>s,



�