python (3.11.7)
    e
                         d Z ddlT ddlmZmZ  G d de          Zd Ze	dk    r! e            Z
 ee
            e             dS dS )	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.
    )*)sleepperf_counterc                        e Zd Zd Zd Zd ZdS )CurvesTurtlec                 (   |dk    rd S |                      |dz             |                     ||dz
  |            |                     |           |                     |dz             |                     ||dz
  |           |                     |           |                     ||dz
  |           |                     |dz             |                     |           |                     ||dz
  |            |                      |dz             d S )Nr   Z      )lefthilbertforwardright)selfsizelevelparitys       L/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/turtledemo/fractalcurves.pyr   zCurvesTurtle.hilbert   s   A::F		&2+T519vg...T
6B;T519f---TT519f---
6B;TT519vg... 	
		&2+    c                 N   dd l }d|z  |                    |j        |z            z  }|                                  |                     |           |                                  |                     dd|dz
  z  |z  z
             t          |          D ]1}|                     |||           |                     d|z             2| 	                    dd|dz
  z  |z  z
             |                                  | 
                    |           |                                  d S )Nr         r	   ih  )mathsinpipufdpdrtrangefractalltbk)r   nradlevdirr   edgeis           r   
fractalgonzCurvesTurtle.fractalgon/   s    3w$'A+...						rQU|a'()))q 	 	ALLsC(((GGC!GrQU|a'()))								r   c                    |dk     r|                      |           d S |                     |dz  |dz
  |           |                     d|z             |                     |dz  |dz
  |           |                     d|z             |                     |dz  |dz
  |           |                     d|z             |                     |dz  |dz
  |           d S )Nr
      <