JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrJFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrU e5d @sTdZddlTddlmZmZGdddeZddZe dkrPeZ e e e d S) a& 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. )*)sleep perf_counterc@s$eZdZddZddZddZdS) CurvesTurtlecCs|dkr dS||d|||d| ||||d|||d||||||d|||d|||||d| ||ddS)NrZ)lefthilbertZforwardright)selfsizelevelZparityr0/usr/lib64/python3.8/turtledemo/fractalcurves.pyr s   zCurvesTurtle.hilbertcCsddl}d|||j|}|||||dd|d|t|D] }|||||d|q\| dd|d||| ||dS)Nrrih) mathZsinZpipufdpdrtrangefractalltZbk)r nZradZlevdirrZedgeirrr fractalgon/s   zCurvesTurtle.fractalgoncCs|dkr||dS||d|d||d|||d|d||d|||d|d||d|||d|d|dS)Nr<x)rrrr)r ZdistZdepthrrrrrBs zCurvesTurtle.fractalN)__name__ __module__ __qualname__r rrrrrrrsrcCst}||d||dd|d}|d|d||t }| d| | || |dd| |tdD]$}|d| |d |d q|td D]}| ||dq|td D]$}| |d |d |dq|t }d ||}td||d||ddt }|dd| |ddd d|| |d|ddd d|t }|d||7}|S)NrriiZredrr@rBzHilbert: %.2fsec. ZblackZbluezKoch: %.2fsec.)rresetZspeedZhtZ getscreenZtracerrZsetposrclockZ fillcolorZ begin_fillrr rrrZend_fillrZcolorr)Zftr ZtartbresrrrmainNs\               r/__main__N) __doc__Zturtletimerrr,ZPenrr/r!msgprintZmainlooprrrrs =9