Ë ‚Ö¦i ã óˆ — d Z ddl G d„ de« Z G d„ de« Zd„ Zd„ Zd „ Ze d k( r e« Z ee « e« yy)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„ Zy)ÚDiscc óØ — t j | dd¬« | j « | j d|dz d« | j |dz dd|dz z « | j « y ) NÚsquareF)ÚshapeÚvisibleg ø?é g @r é )ÚTurtleÚ__init__ÚpuÚ shapesizeÚ fillcolorÚst)ÚselfÚns ú1/usr/lib64/python3.12/turtledemo/minimal_hanoi.pyr z Disc.__init__ sV € Ü�‰˜ 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„ Zy)ÚTowerz-Hanoi tower, a subclass of built-in type listc ó — || _ y)z-create an empty tower. x is x-position of pegN)Úx)r r s r r zTower.__init__ s € àˆ�r c óœ — |j | j « |j ddt | « z z « | j |« y )Nijÿÿÿé" )Úsetxr ÚsetyÚlenÚappend©r Úds r Úpushz Tower.push# s5 € Ø �‰ˆt�v‰vŒØ �‰ˆt�B”s˜4“y‘LÑ Ô!Ø�‰�A�r c óR — t j | « }|j d« |S )Né– )ÚlistÚpopr! r$ s r r* z Tower.pop' s € Ü�H‰H�T‹NˆØ �‰ˆsŒØˆr N)r r r Ú__doc__r r&