HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/turtledemo/__pycache__/bytedesign.cpython-37.pyc
B

"��g��@sXdZddlmZmZddlmZGdd�de�Zdd�Ze	dkrTe�Z
ee
�e�d	S)
a�      turtle-example-suite:

        tdemo_bytedesign.py

An example adapted from the example-suite
of PythonCard's turtle graphics.

It's based on an article in BYTE magazine
Problem Solving with Logo: Using Turtle
Graphics to Redraw a Design
November 1982, p. 118 - 134

-------------------------------------------

Due to the statement

t.delay(0)

in line 152, which sets the animation delay
to 0, this animation runs in "line per line"
mode as fast as possible.
�)�Turtle�mainloop)�perf_counterc@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�DesignercCs�|��xVtd�D]J}|�d|�|��|�|��|�|��|�d|�|�d�qW|��|�|�|�d�|�d|�|�d�|��|�	d|d|�|�
��d	�dS)
N�g�����)P@�H�$g�8@���.g������a@T)�up�range�forward�down�wheel�position�backward�right�goto�centerpiece�	getscreen�tracer)�selfZhomePos�scale�i�r�1/usr/local/lib/python3.7/turtledemo/bytedesign.py�design s 


zDesigner.designcCs�|�d�xtd�D]}|�||�qW|��|�d�xtd�D]}|�||�qDW|�d�xFtd�D]:}|��|�d�|�d|�|��|�d|�qlW|�d�|�	��
�dS)N�6�rrr�)rr�	pentpiecer�left�tripiecer
rrr�update)r�initposrrrrrr2s 




zDesigner.wheelcCs�|��}|��|�d|�|�d||�|��|�|�|�|�|��|�d|�|�d||�|��|�|�|�|�|�d�|�	��
�dS)Ng@g�?@r)�headingrr�tripolyrrr�
setheading�tripolylr!rr#)rr$r�oldhrrrr"Ds




zDesigner.tripiececCs|��}|��|�d|�|��x(td�D]}|�d|�|�d�q0W|�d|d|�|��|�|�|�|�|�d|�|��x(td�D]}|�d|�|�d�q�W|�	d|d|�|��|�|�|�|�|�
d�|����dS)N�r�r�K)
r%rr
rrr�pentrrr'�pentlr!rr#)rr$rr)rrrrr Us,




zDesigner.pentpiececCs>|d|krdS|�|�|�|�|�|d|||�dS)N�gR���Q�?)r
r!r.)r�side�angrrrrr.ms


zDesigner.pentlcCs>|d|krdS|�|�|�|�|�|d|||�dS)Nr/gR���Q�?)r
rr-)rr0r1rrrrr-ss


zDesigner.pentrcCsh|d|krdS|�|�|�d�|�|d�|�d�|�|d�|�d�|�|d|�dS)Nr�og{�G�z�?g�������?�g�?)r
rr&)rr0rrrrr&ys



zDesigner.tripolyrcCsh|d|krdS|�|�|�d�|�|d�|�d�|�|d�|�d�|�|d|�dS)Nrr2g{�G�z�?g�������?r3g�?)r
r!r()rr0rrrrr(�s



zDesigner.tripolylcCs>|�|�|�|�|d|kr$dS|�|d|||�dS)Ng@g333333�?)r
r!r)r�s�arrrrr�s


zDesigner.centerpieceN)�__name__�
__module__�__qualname__rrr"r r.r-r&r(rrrrrrs

rcCs\t�}|�d�|��|���d�|���d�t�}|�|��d�t�}d||S)Nrr/zruntime: %.2f sec.)	rZspeedZ
hideturtlerZdelayr�clockrr)�tZat�etrrr�main�s
r<�__main__N)�__doc__ZturtlerrZtimerr9rr<r6�msg�printrrrr�<module>su