HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/turtledemo/__pycache__/fractalcurves.cpython-310.opt-1.pyc
o

�i�
�@sXdZddlTddlmZmZGdd�de�Zdd�Ze	dkr*e�Z
ee
�e�d	Sd	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$eZdZdd�Zdd�Zdd�ZdS)�CurvesTurtlecCs�|dkrdS|�|d�|�||d|�|�|�|�|d�|�||d|�|�|�|�||d|�|�|d�|�|�|�||d|�|�|d�dS)Nr�Z�)�left�hilbertZforward�right)�self�size�levelZparity�r�5/usr/local/lib/python3.10/turtledemo/fractalcurves.pyr	s


zCurvesTurtle.hilbertcCs�ddl}d||�|j|�}|��|�|�|��|�dd|d|�t|�D]}|�|||�|�d|�q.|�	dd|d|�|��|�
|�|��dS)Nr��rih)�math�sin�pi�pu�fd�pd�rt�range�fractal�ltZbk)r�nZradZlev�dirrZedge�irrr�
fractalgon/s

zCurvesTurtle.fractalgoncCs�|dkr|�|�dS|�|d|d|�|�d|�|�|d|d|�|�d|�|�|d|d|�|�d|�|�|d|d|�dS)Nr��<�x)rrrr)r�dist�depthrrrrrBs
zCurvesTurtle.fractalN)�__name__�
__module__�__qualname__r	rrrrrrrsrcCs�t�}|��|�d�|��|���dd�|��d}|�d|d|�|��t	�}|�
d�|��|�|�|�
|dd�|�|�td�D]}|�d�|�|d	|d
�qM|��td
�D]}|�|�|�d�qh|��td�D]}|�|d|d
�|�d�q}|��t	�}d
||}td�|��|�d�|��|���dd�t	�}|�dd�|��|�dddd�|��|��|�d�|�dddd�|��t	�}|d||7}|S)Nrr�i���i��Zredr r�@r��BzHilbert: %.2fsec. ZblackZblue������zKoch: %.2fsec.)r�resetZspeedZhtZ	getscreenZtracerrZsetposr�clockZ	fillcolorZ
begin_fillrr	rrrZend_fillrZcolorr)Zftr�tar�tb�resrrr�mainNs\







r4�__main__N)
�__doc__Zturtle�timerrr0ZPenrr4r%�msg�printZmainlooprrrr�<module>s=9
�