3 ^c@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@ii.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)Ni6rrri) rr pentpiecer lefttripiecer rrrupdate)rinitposrrrrrr 2s      zDesigner.wheelcCs|j}|j|jd||jd|||j|j||j||j|jd||jd|||j|j||j||jd|j j dS)Ng@g?@r) headingr rtripolyrrr setheadingtripolylrrr)rrroldhrrrrDs     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)NiririK) r rr r r rpentrrr"pentlrrr)rrrr$rrrrrUs,     zDesigner.pentpiececC>|d|krdS|j||j||j|d|||dSNgRQ?)r rr&rsideZangrrrrr&m    zDesigner.pentlcCr'r()r rr%r*rrrr%sr,zDesigner.pentrcCh|d|krdS|j||jd|j|d|jd|j|d|jd|j|d|dSNriog{Gz?g?ig?)r rr!rr+rrrrr!y     zDesigner.tripolyrcCr-r.)r rr#r/rrrr#r0zDesigner.tripolylcCs>|j||j||d|kr$dS|j|d|||dS)Ng@g333333?)r rr)rZsZarrrrrs   zDesigner.centerpieceN) __name__Z __module__Z __qualname__rr rrr&r%r!r#rrrrrrs  rcCs\t}|jd|j|jjd|jjdt}|j|jdt}d||S)Nrr)zruntime: %.2f sec.) rZspeedZ hideturtlerZdelayrrrr )ZtZatZetrrrmains r2Z__main__N) ZturtlerrZtimerrr2r1ZmsgZprintrrrrZs u