ROOTPLOIT
Server: LiteSpeed
System: Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User: niphet (1079)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: //lib64/python3.8/turtledemo/__pycache__/minimal_hanoi.cpython-38.pyc
U

e5d@sddZddlTGdddeZGdddeZddZd	d
ZddZe	d
kr`eZ
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@seZdZddZdS)DisccCsPtj|ddd||d|dd||ddd|d|dS)	NZsquareF)shapeZvisibleg?g@r)Turtle__init__ZpuZ	shapesizeZ	fillcolorst)selfnr0/usr/lib64/python3.8/turtledemo/minimal_hanoi.pyrs
z
Disc.__init__N)__name__
__module____qualname__rrrrr
rsrc@s(eZdZdZddZddZddZdS)	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")Zsetxrsetylenappendr
drrr
push#sz
Tower.pushcCst|}|d|S)N)listpoprrr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,srcCsJtddtz tdttttddddWntk
rDYnXdS)Nspacezpress STOP button to exitcenterZCourierZboldZalignZfont)onkeyclearrt1t2t3writeZ
Terminatorrrrr
play2s

r+cCsptttddtdatdatdatdddD]}tt	|q:t
ddd	d
ttdt
dS)
Nriir zpress spacebar to start gamer!r"r$rZ	EVENTLOOP)ZhtZpenupZgotorr'r(r)rangerrr*r%r+Zlisten)irrr
main<s

r0__main__N)
rZturtlerrrrrr+r0rmsgprintZmainlooprrrr
<module>s