Your IP : 18.189.29.36
�
Afc@sdZddlZddlmZmZddlmZdefd��YZd�Ze dkr{e�Z
e
GHe�ndS( 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(tTurtletmainloop(tclocktDesignercBsYeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z
RS( cCs�|j�xmtd�D]_}|jd|�|j�|j|j�|�|j�|jd|�|jd�qW|j�|j|�|jd�|jd|�|jd�|j�|j d|d|�|j
t�dS( Nig�����)P@iHi$g�8@i�i.g������a@(tuptrangetforwardtdowntwheeltpositiontbackwardtrighttgototcenterpiecettracertTrue(tselfthomePostscaleti((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pytdesign!s
cCs�|jd�x$td�D]}|j||�qW|j�|jd�x$td�D]}|j||�qXW|jd�xWtd�D]I}|j�|jd�|jd|�|j�|jd|�q�W|jd�|j �j
�dS(Ni6ii$iiHi(RRt pentpieceRtleftttripieceRRR
t getscreentupdate(RtinitposRR((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyR3s
cCs�|j�}|j�|jd|�|jd||�|j�|j|�|j|�|j�|jd|�|jd||�|j�|j|�|j|�|jd�|j �j
�dS(Ng@g�?@iH(theadingRR
ttripolyrRRt
setheadingttripolylRRR(RRRtoldh((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyREs
cCsM|j�}|j�|jd|�|j�x2td�D]$}|jd|�|jd�q>W|jd|d|�|j�|j|�|j|�|jd|�|j�x2td�D]$}|jd|�|jd�q�W|j d|d|�|j�|j|�|j|�|j
d�|j�j�dS(NiiiiHiK(
RRRRRRtpentrRRtpentlRRR(RRRRR((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyRVs,
cCsM|d|krdS|j|�|j|�|j|d|||�dS(NigR���Q�?(RRR!(RtsidetangR((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyR!ns
cCsM|d|krdS|j|�|j|�|j|d|||�dS(NigR���Q�?(RRR (RR"R#R((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyR ts
cCs�|d|krdS|j|�|jd�|j|d�|jd�|j|d�|jd�|j|d|�dS(Niiog{�G�z�?g�������?i�g�?(RRR(RR"R((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyRzs
cCs�|d|krdS|j|�|jd�|j|d�|jd�|j|d�|jd�|j|d|�dS(Niiog{�G�z�?g�������?i�g�?(RRR(RR"R((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyR�s
cCsM|j|�|j|�|d|kr.dS|j|d|||�dS(Ng@g333333�?(RRR
(RtstaR((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyR
�s
(t__name__t
__module__RRRRR!R RRR
(((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyRs
cCstt�}|jd�|j�|j�jd�|jd�t�}|j|j�d�t�}d||S(Niisruntime: %.2f sec.( Rtspeedt
hideturtleRtdelayRRRR (tttattet((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pytmain�s
t__main__(t__doc__tmathtturtleRRttimeRRR.R&tmsg(((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyt<module>su
?>