Linux premium71.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
LiteSpeed
Server IP : 198.187.29.8 & Your IP : 3.142.144.163
Domains :
Cant Read [ /etc/named.conf ]
User : cleahvkv
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib64 /
python3.8 /
turtledemo /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2024-03-05 23:45
__init__.py
314
B
-rw-r--r--
2023-06-06 13:32
__main__.py
13.91
KB
-rw-r--r--
2023-10-17 18:12
bytedesign.py
4.15
KB
-rwxr-xr-x
2023-06-06 13:32
chaos.py
951
B
-rw-r--r--
2023-06-06 13:32
clock.py
3.13
KB
-rwxr-xr-x
2023-06-06 13:32
colormixer.py
1.31
KB
-rw-r--r--
2023-06-06 13:32
forest.py
2.9
KB
-rwxr-xr-x
2023-06-06 13:32
fractalcurves.py
3.39
KB
-rwxr-xr-x
2023-06-06 13:32
lindenmayer.py
2.38
KB
-rwxr-xr-x
2023-06-06 13:32
minimal_hanoi.py
2
KB
-rwxr-xr-x
2023-06-06 13:32
nim.py
6.36
KB
-rw-r--r--
2023-06-06 13:32
paint.py
1.26
KB
-rwxr-xr-x
2023-06-06 13:32
peace.py
1.04
KB
-rwxr-xr-x
2023-06-06 13:32
penrose.py
3.3
KB
-rwxr-xr-x
2023-06-06 13:32
planet_and_moon.py
2.76
KB
-rwxr-xr-x
2023-06-06 13:32
rosette.py
1.33
KB
-rw-r--r--
2023-06-06 13:32
round_dance.py
1.76
KB
-rw-r--r--
2023-06-06 13:32
sorting_animate.py
4.91
KB
-rw-r--r--
2023-10-17 18:12
tree.py
1.37
KB
-rwxr-xr-x
2023-06-06 13:32
turtle.cfg
160
B
-rw-r--r--
2023-06-06 13:32
two_canvases.py
1.09
KB
-rw-r--r--
2023-06-06 13:32
yinyang.py
820
B
-rwxr-xr-x
2023-06-06 13:32
Save
Rename
#! /usr/bin/python3.8 """ 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 --------------------------------------- """ from turtle import * class Disc(Turtle): def __init__(self, n): Turtle.__init__(self, shape="square", visible=False) self.pu() self.shapesize(1.5, n*1.5, 2) # square-->rectangle self.fillcolor(n/6., 0, 1-n/6.) self.st() class Tower(list): "Hanoi tower, a subclass of built-in type list" def __init__(self, x): "create an empty tower. x is x-position of peg" self.x = x def push(self, d): d.setx(self.x) d.sety(-150+34*len(self)) self.append(d) def pop(self): d = list.pop(self) d.sety(150) return d def hanoi(n, from_, with_, to_): if n > 0: hanoi(n-1, from_, to_, with_) to_.push(from_.pop()) hanoi(n-1, with_, from_, to_) def play(): onkey(None,"space") clear() try: hanoi(6, t1, t2, t3) write("press STOP button to exit", align="center", font=("Courier", 16, "bold")) except Terminator: pass # turtledemo user pressed STOP def main(): global t1, t2, t3 ht(); penup(); goto(0, -225) # writer turtle t1 = Tower(-250) t2 = Tower(0) t3 = Tower(250) # make tower of 6 discs for i in range(6,0,-1): t1.push(Disc(i)) # prepare spartanic user interface ;-) write("press spacebar to start game", align="center", font=("Courier", 16, "bold")) onkey(play, "space") listen() return "EVENTLOOP" if __name__=="__main__": msg = main() print(msg) mainloop()