ok
Direktori : /lib64/python2.7/Demo/turtle/ |
Current File : //lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyo |
� цdc @ s d Z d d l Z d d l m Z m Z d d l m Z d e f d � � YZ d � Z e d k r{ e � Z e GHe � n d S( s� turtle-example-suite: tdemo_bytedesign.py An example adapted from the example-suite of PythonCard's turtle graphcis. 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. i����N( t Turtlet mainloop( t clockt Designerc B sY e Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z RS( c C s� | j � xm t d � D]_ } | j d | � | j � | j | j � | � | j � | j d | � | j d � q W| j � | j | � | j d � | j d | � | j d � | j � | j d | d | � | j t � d S( Ni g�����)P@iH i$ g �8@i� i. g������a@( t upt ranget forwardt downt wheelt positiont backwardt rightt gotot centerpiecet tracert True( t selft homePost scalet i( ( s4 /usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyt design! s c C s� | j d � x$ t d � D] } | j | | � q W| j � | j d � x$ t d � D] } | j | | � qX W| j d � xW t d � D]I } | j � | j d � | j d | � | j � | j d | � q� W| j d � | j � j � d S( Ni6 i i$ i iH i ( R R t pentpieceR t leftt tripieceR R R t getscreent update( R t initposR R ( ( s4 /usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyR 3 s c C s� | j � } | j � | j d | � | j d | | � | j � | j | � | j | � | j � | j d | � | j d | | � | j � | j | � | j | � | j d � | j � j � d S( Ng @g �?@iH ( t headingR R t tripolyrR R t setheadingt tripolylR R R ( R R R t oldh( ( s4 /usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyR E s c C sM | j � } | j � | j d | � | j � x2 t d � D]$ } | j d | � | j d � q>