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: //lib64/python3.9/turtledemo/__pycache__/minimal_hanoi.cpython-39.opt-1.pyc
a

R�f�@sddZddlTGdd�de�ZGdd�de�Zdd�Zd	d
�Zdd�Ze	d
kr`e�Z
ee
�e�dS)a�       turtle-example-suite:

         tdemo_minimal_hanoi.py

A minimal 'Towers of Hanoi' animation:
A tower of 6 discs is transferred from the
left to the right peg.

An imho quite elegant and concise
implementation using a tower class, which
is derived from the built-in type list.

Discs are turtles with shape "square", but
stretched to rectangles by shapesize()
 ---------------------------------------
       To exit press STOP button
 ---------------------------------------
�)�*c@seZdZdd�ZdS)�DisccCsPtj|ddd�|��|�d|dd�|�|ddd|d�|��dS)	NZsquareF)�shapeZvisibleg�?�g@r�)�Turtle�__init__ZpuZ	shapesizeZ	fillcolor�st)�self�n�r�0/usr/lib64/python3.9/turtledemo/minimal_hanoi.pyrs
z
Disc.__init__N)�__name__�
__module__�__qualname__rrrrr
rsrc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�Towerz-Hanoi tower, a subclass of built-in type listcCs
||_dS)z-create an empty tower. x is x-position of pegN)�x)r
rrrr
r szTower.__init__cCs0|�|j�|�ddt|��|�|�dS)Nij����")Zsetxr�sety�len�append�r
�drrr
�push#sz
Tower.pushcCst�|�}|�d�|S)N�)�list�poprrrrr
r's

z	Tower.popN)rrr�__doc__rrrrrrr
rsrcCs>|dkr:t|d|||�|�|���t|d|||�dS)Nrr)�hanoirr)rZfrom_Zwith_Zto_rrr
r,srcCsHtdd�t�z tdttt�tdddd�WntyBYn0dS)N�space�zpress STOP button to exit�center�ZCourier�Zbold�ZalignZfont)�onkey�clearr�t1�t2�t3�writeZ
Terminatorrrrr
�play2s
�
r+cCspt�t�tdd�td�atd�atd�atddd�D]}t�t	|��q:t
ddd	d
�ttd�t
�dS)
Nri���i����r ���zpress spacebar to start gamer!r"r$rZ	EVENTLOOP)ZhtZpenupZgotorr'r(r)�rangerrr*r%r+�listen)�irrr
�main<s�
r1�__main__N)
rZturtlerrrrrr+r1r�msg�printZmainlooprrrr
�<module>s