There really is no hope of making this code even half-way decent without spending the time to rewrite them all properly. Don't want to do any of that
38 lines
1.0 KiB
Python
Executable File
38 lines
1.0 KiB
Python
Executable File
import random
|
|
import turtle
|
|
import time
|
|
|
|
turtle.pu()
|
|
|
|
|
|
def vieleck_random_randomize():
|
|
for i in range(random.randint(25, 100)):
|
|
turtle.color(random.random(), random.random(), random.random())
|
|
size = random.randint(50, 200)
|
|
turtle.width(random.randint(2, 10))
|
|
ecken = random.randint(3, 20)
|
|
turtle.setpos(random.randint(-300, 300), random.randint(-300, 300))
|
|
fuellen = random.randint(0, 1)
|
|
turtle.pd()
|
|
if fuellen >= 1:
|
|
turtle.begin_fill()
|
|
for i in range(ecken):
|
|
turtle.fd(size / ecken)
|
|
turtle.rt(360 / ecken)
|
|
turtle.end_fill()
|
|
else:
|
|
for i in range(ecken):
|
|
turtle.fd(size / ecken)
|
|
turtle.rt(360 / ecken)
|
|
turtle.pu()
|
|
|
|
|
|
print("Random Design")
|
|
draw_time_start = time.time()
|
|
vieleck_random_randomize()
|
|
draw_time_end = time.time()
|
|
print("Drawing has taken", draw_time_end - draw_time_start, "seconds")
|
|
print("Click to exit")
|
|
|
|
turtle.exitonclick()
|