/opt/imh/python3.13/lib/python3.13/turtledemo/__pycache__
Edit: /opt/imh/python3.13/lib/python3.13/turtledemo/__pycache__/minimal_hanoi.cpython-313.pyc (4047B)
e S r SSK7 " S S\5 r " S S\5 rS rS rS r\ S
:X a \" 5 r
\" \
5 \" 5 gg)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 \ rS rSrS rSrg)Disc c [ R U SSS9 U R 5 U R SUS- S5 U R US- SSUS- -
5 U R 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__ sV He< sAcE1%qtQ!B$' N)__name__
__module____qualname____firstlineno__r __static_attributes__r r r r r s r r c * \ rS rSrSrS rS rS rSrg)Tower z-Hanoi tower, a subclass of built-in type listc Xl g)z-create an empty tower. x is x-position of pegNx)r r# s r r Tower.__init__ s r c UR U R 5 UR SS[ U 5 - - 5 U R U5 g )Nij" )setxr# setylenappendr ds r push
Tower.push# s5 tvv tBs4yL !Ar c R [ R U 5 nUR S5 U$ )N )listpopr( r+ s r r2 Tower.pop' s HHTN sr r" N) r r r r __doc__r r- r2 r r r r r r s 3r r c U S: a@ [ U S-
XU5 UR UR 5 5 [ U S-
X!U5 g g )Nr r )hanoir- r2 )r from_with_to_s r r6 r6 , s@ 1u
ac5u%
ac5%
r c [ S S5 [ 5 [ S[ [ [
5 [
SSSS9 g ! [ a g f = f)Nspace zpress STOP button to exitcenterCourier boldalignfont)onkeyclearr6 t1t2t3write
Terminatorr r r playrL 2 sG $w G
aR
)#: <
s %>
A
Ac 4 [ 5 [ 5 [ SS5 [ S5 q[ S5 q[ S5 q[ SSS5 H! n [ R [ U 5 5 M# [ SSS S
9 [ [ S5 [ 5 g)
Nr ii r<