����JFIF���������
1#@!#!123s
D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
usr
/
lib64
/
python3.8
/
turtledemo
/
__pycache__
/
Filename :
bytedesign.cpython-38.pyc
back
Copy
U ����e5d�����������������������@���sX���d�Z�ddlmZmZ�ddlmZ�G�dd��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�������������������@���sT���e�Zd�Zdd��Zdd��Zdd��Zdd��Zd d ��Zdd��Zd d��Z dd��Z dd��ZdS�)�Designerc�����������������C���s����|������td�D�]J}|��d|���|�����|��|����|��|������|��d|���|��d��q|������|��|��|��d��|��d|���|��d��|�����|�� d|�d|��|�� ���d ��d�S�) 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����-/usr/lib64/python3.8/turtledemo/bytedesign.py�design ���s ���� zDesigner.designc�����������������C���s����|���d��td�D�]}|��||��q|�����|��d��td�D�]}|��||��q>|��d��td�D�]:}|�����|���d��|��d|���|�����|��d|���qb|��d��|�� ��� ���d�S�)N�6�������r���r���r�������)r���r���� pentpiecer����left�tripiecer ���r���r���r����update)r����initposr���r���r���r���r���r���2���s ���� zDesigner.wheelc�����������������C���s����|�����}|�����|��d|���|��d|�|��|�����|��|��|��|��|�����|��d|���|��d|�|��|�����|��|��|��|��|��d��|�� ��� ���d�S�)Ng������@g������?@r���)�headingr���r����tripolyrr���r���� setheading�tripolylr!���r���r#���)r���r$���r����oldhr���r���r���r"���D���s���� zDesigner.tripiecec�����������������C���s����|�����}|�����|��d|���|�����td�D�]}|��d|���|��d��q.|��d|�d|��|�����|��|��|��|��|��d|���|�����td�D�]}|��d|���|��d��q�|�� d|�d|��|�����|��|��|��|��|�� d��|��������d�S�)N����r�������r����K���) r%���r���r ���r���r���r����pentrr���r'����pentlr!���r���r#���)r���r$���r���r)���r���r���r���r���r ���U���s,���� zDesigner.pentpiecec�����������������C���s>���|d|�k�rd�S�|���|��|��|��|��|d|��||��d�S��N����gR���Q�?)r ���r!���r.����r����sideZangr���r���r���r���r.���m���s ����� zDesigner.pentlc�����������������C���s>���|d|�k�rd�S�|���|��|��|��|��|d|��||��d�S�r/���)r ���r���r-���r1���r���r���r���r-���s���s ����� zDesigner.pentrc�����������������C���sh���|d|�k�rd�S�|���|��|��d��|���|d���|��d��|���|d���|��d��|��|d�|��d�S��Nr����o���g{�G�z�?g�������?����g�������?)r ���r���r&����r���r2���r���r���r���r���r&���y���s����� zDesigner.tripolyrc�����������������C���sh���|d|�k�rd�S�|���|��|��d��|���|d���|��d��|���|d���|��d��|��|d�|��d�S�r3���)r ���r!���r(���r6���r���r���r���r(�������s����� zDesigner.tripolylc�����������������C���s>���|���|��|��|��|d|�k�r$d�S�|��|d|��||��d�S�)Ng������@g333333�?)r ���r!���r���)r����s�ar���r���r���r���r�������s ���� � zDesigner.centerpieceN)�__name__� __module__�__qualname__r���r���r"���r ���r.���r-���r&���r(���r���r���r���r���r���r������s��� r���c������������������C���s\���t���}�|��d��|�����|�����d��|�����d��t��}|��|����d��t��}d||��S�)Nr���r0���zruntime: %.2f sec.) r���ZspeedZ hideturtler���Zdelayr����clockr���r���)�tZatZetr���r���r����main����s���� r>����__main__N)�__doc__Zturtler���r����timer���r<���r���r>���r9����msg�printr���r���r���r����<module>���s���u