X7ROOT File Manager
Current Path:
/lib64/python3.8/turtledemo
lib64
/
python3.8
/
turtledemo
/
??
..
??
__init__.py
(314 B)
??
__main__.py
(13.91 KB)
??
__pycache__
??
bytedesign.py
(4.15 KB)
??
chaos.py
(951 B)
??
clock.py
(3.13 KB)
??
colormixer.py
(1.31 KB)
??
forest.py
(2.9 KB)
??
fractalcurves.py
(3.39 KB)
??
lindenmayer.py
(2.38 KB)
??
minimal_hanoi.py
(2 KB)
??
nim.py
(6.36 KB)
??
paint.py
(1.26 KB)
??
peace.py
(1.04 KB)
??
penrose.py
(3.3 KB)
??
planet_and_moon.py
(2.76 KB)
??
rosette.py
(1.33 KB)
??
round_dance.py
(1.76 KB)
??
sorting_animate.py
(4.91 KB)
??
tree.py
(1.37 KB)
??
turtle.cfg
(160 B)
??
two_canvases.py
(1.09 KB)
??
yinyang.py
(820 B)
Editing: chaos.py
# File: tdemo_chaos.py # Author: Gregor Lingl # Date: 2009-06-24 # A demonstration of chaos from turtle import * N = 80 def f(x): return 3.9*x*(1-x) def g(x): return 3.9*(x-x**2) def h(x): return 3.9*x-3.9*x*x def jumpto(x, y): penup(); goto(x,y) def line(x1, y1, x2, y2): jumpto(x1, y1) pendown() goto(x2, y2) def coosys(): line(-1, 0, N+1, 0) line(0, -0.1, 0, 1.1) def plot(fun, start, color): pencolor(color) x = start jumpto(0, x) pendown() dot(5) for i in range(N): x=fun(x) goto(i+1,x) dot(5) def main(): reset() setworldcoordinates(-1.0,-0.1, N+1, 1.1) speed(0) hideturtle() coosys() plot(f, 0.35, "blue") plot(g, 0.35, "green") plot(h, 0.35, "red") # Now zoom in: for s in range(100): setworldcoordinates(0.5*s,-0.1, N+1, 1.1) return "Done!" if __name__ == "__main__": main() mainloop()
Upload File
Create Folder