JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrJFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr Afc@smdZddlTddlmZmZdefdYZdZedkrieZ e GHe ndS( s& turtle-example-suite: tdemo_fractalCurves.py This program draws two fractal-curve-designs: (1) A hilbert curve (in a box) (2) A combination of Koch-curves. The CurvesTurtle class and the fractal-curve- methods are taken from the PythonCard example scripts for turtle-graphics. i(t*(tsleeptclockt CurvesTurtlecBs#eZdZdZdZRS(cCs|dkrdS|j|d|j||d| |j||j|d|j||d||j||j||d||j|d|j||j||d| |j|ddS(NiiZi(tleftthilberttforwardtright(tselftsizetleveltparity((s7/usr/lib64/python2.7/Demo/turtle/tdemo_fractalcurves.pyRs    cCsddl}d||j|j|}|j|j||j|jdd|d|x8t|D]*}|j||||jd|quW|j dd|d||j|j ||jdS(NiiiiZih( tmathtsintpitputfdtpdtrttrangetfractaltlttbk(RtntradtlevtdirR tedgeti((s7/usr/lib64/python2.7/Demo/turtle/tdemo_fractalcurves.pyt fractalgon/s      cCs|dkr|j|dS|j|d|d||jd||j|d|d||jd||j|d|d||jd||j|d|d|dS(Niii<ix(RRRR(RtdisttdepthR((s7/usr/lib64/python2.7/Demo/turtle/tdemo_fractalcurves.pyRBs  (t__name__t __module__RRR(((s7/usr/lib64/python2.7/Demo/turtle/tdemo_fractalcurves.pyRs  cCsrt}|j|jd|j|jdd|jd}|jd|d||jt}|j d|j t |j ||j |dd|j |x:tdD],}|jd|j |d |d qW|jx.td D] }|j ||jdqW|jx:td D],}|j |d |d |jdqKW|j tt}d ||}td|j|jd|j|jddt}|jdd|j t |jddd d|j t |jd|jddd d|j tt}|d||7}|S(NiiiiitrediiZi@iiiBsHilbert: %.2fsec. tblacktblueiiisKoch: %.2fsec.(RtresettspeedthtttracerRtsetposRRt fillcolortfilltTrueRRRRRtFalseRtcolorR(tftR ttaRttbtres((s7/usr/lib64/python2.7/Demo/turtle/tdemo_fractalcurves.pytmainNsZ                           t__main__N( t__doc__tturtlettimeRRtPenRR3R tmsgtmainloop(((s7/usr/lib64/python2.7/Demo/turtle/tdemo_fractalcurves.pyt s = 8