eSrSSK7 "SS\5r"SS\5rSrSrS r\ S :Xa\"5r \ "\ 5 \ "5 g g ) aturtle-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\rSrSrSrSrg)Discc[RUSSS9 UR5 URSUS-S5 UR US- SSUS- - 5 UR 5 g) NsquareF)shapevisibleg?g@r)Turtle__init__pu shapesize fillcolorst)selfns >/opt/imh/python3.13/lib/python3.13/turtledemo/minimal_hanoi.pyr Disc.__init__sVHe<   sAcE1% qtQ!B$'  N)__name__ __module__ __qualname____firstlineno__r__static_attributes__rrrrrsrrc*\rSrSrSrSrSrSrSrg)Towerz-Hanoi tower, a subclass of built-in type listcXlg)z-create an empty tower. x is x-position of pegNx)rr#s rrTower.__init__ srcURUR5 URSS[U5--5 UR U5 g)Nij")setxr#setylenappendrds rpush Tower.push#s5 tvv tBs4yL ! ArcR[RU5nURS5 U$)N)listpopr(r+s rr2 Tower.pop's HHTN s rr"N) rrrr__doc__rr-r2rrrrrrs3rrcUS:a@[US- XU5 URUR55 [US- X!U5 gg)Nrr )hanoir-r2)rfrom_with_to_s rr6r6,s@1u ac5u%  ac5% rc[SS5 [5 [S[[[ 5 [ SSSS9 g![a gf=f)Nspacezpress STOP button to exitcenterCourierboldalignfont)onkeyclearr6t1t2t3write TerminatorrrrplayrL2sG $w G  aR )#: <    s%> A  A c4[5 [5 [SS5 [S5q[S5q[S5q[SSS5H!n[R[U55 M# [SSS S 9 [[S 5 [5 g ) Nriir<zpress spacebar to start gamer=r>rBr; EVENTLOOP)htpenupgotorrGrHrIranger-rrJrErLlisten)is rmainrW<suD%'44= tB qB sB 1Qr] Q (68 $ H r__main__N) r4turtler rr1rr6rLrWrmsgprintmainlooprrrr]sX$6 D &    Z &C #J Jr