3 ^@sTddlmZmZddlmZGdddeZddZedkrPeZe eedS) )Turtlemainloop)clockc@sTeZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ dS)DesignercCs|jxVtdD]J}|jd||j|j|j||j|jd||jdqW|j|j||jd|jd||jd|j|j d|d||j j d dS) Ng)P@H$g8@.ga@T) uprangeforwarddownwheelpositionbackwardrightgoto centerpiece getscreentracer)selfZhomePosscaleir-/usr/lib64/python3.6/turtledemo/bytedesign.pydesign s    zDesigner.designcCs|jdxtdD]}|j||qW|j|jdxtdD]}|j||qDW|jdxFtdD]:}|j|jd|jd||j|jd|qlW|jd|j j dS)N6rrr) rr pentpiecerlefttripiecer r rrupdate)rinitposrrrrrr2s      zDesigner.wheelcCs|j}|j|jd||jd|||j|j||j||j|jd||jd|||j|j||j||jd|j j dS)Ng@g?@r) headingrrtripolyrr r setheadingtripolylr!rr#)rr$roldhrrrr"Ds     zDesigner.tripiececCs|j}|j|jd||jx(tdD]}|jd||jdq0W|jd|d||j|j||j||jd||jx(tdD]}|jd||jdqW|j d|d||j|j||j||j d|j j dS)NrrK) r%r r rr rpentrrr'pentlr!rr#)rr$rr)rrrrr Us,     zDesigner.pentpiececCs>|d|krdS|j||j||j|d|||dS)NgRQ?)r r!r.)rsideangrrrrr.ms    zDesigner.pentlcCs>|d|krdS|j||j||j|d|||dS)Nr/gRQ?)r rr-)rr0r1rrrrr-ss    zDesigner.pentrcCsh|d|krdS|j||jd|j|d|jd|j|d|jd|j|d|dS)Nrog{Gz?g?g?)r rr&)rr0rrrrr&ys     zDesigner.tripolyrcCsh|d|krdS|j||jd|j|d|jd|j|d|jd|j|d|dS)Nrr2g{Gz?g?r3g?)r r!r()rr0rrrrr(s     zDesigner.tripolylcCs>|j||j||d|kr$dS|j|d|||dS)Ng@g333333?)r r!r)rsarrrrrs   zDesigner.centerpieceN) __name__ __module__ __qualname__rrr"r r.r-r&r(rrrrrrs  rcCs\t}|jd|j|jjd|jjdt}|j|jdt}d||S)Nrr/zruntime: %.2f sec.) rZspeedZ hideturtlerZdelayrrrr)tZatZetrrrmains r:__main__N) ZturtlerrZtimerrr:r6msgprintrrrrs u