�
�f � � � d Z ddlT G d� de� � Z G d� de� � Zd� Zd� Zd � Ze d
k r! e� � Z
ee
� � e� � dS 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 � � e Zd Zd� ZdS )�Discc � � t � | dd�� � | � � � | � d|dz d� � | � |dz dd|dz z
� � | � � � d S ) N�squareF)�shape�visibleg �?� g @r � )�Turtle�__init__�pu� shapesize� fillcolor�st)�self�ns �1/usr/lib64/python3.11/turtledemo/minimal_hanoi.pyr
z
Disc.__init__ st � �����H�e��<�<�<���� � � ����s�A�c�E�1�%�%�%����q��t�Q��!�B�$��'�'�'���� � � � � � N)�__name__�
__module__�__qualname__r
� r r r r s# � � � � � �� � � � r r c �$ � e Zd ZdZd� Zd� Zd� ZdS )�Towerz-Hanoi tower, a subclass of built-in type listc � � || _ dS )z-create an empty tower. x is x-position of pegN)�x)r r s r r
zTower.__init__ s
� �����r c � � |� | j � � |� ddt | � � z z � � | � |� � d S )Nij����"