%PDF- %PDF-
Direktori : /usr/lib64/python3.8/turtledemo/__pycache__/ |
Current File : //usr/lib64/python3.8/turtledemo/__pycache__/bytedesign.cpython-38.pyc |
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"