Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #RandomSpiralDamianRivera.py
- import turtle
- import random
- t= turtle.Pen()
- window = turtle.Screen()
- window.bgcolor("black")
- colors=["red", "white", "blue" , "pink", "magenta", "yellow", "orange", "green"]
- def spiral ():
- x = random.randrange(-turtle.window_width()//2,
- turtle.window_width()//2)
- y = random.randrange(-turtle.window_height()//2,
- turtle.window_height()//2)
- size = random.randint(10, 40)
- t.pencolor(random.choice((colors)))
- t.penup()
- t.setpos(x, y)
- t.pendown()
- for w in range (size):
- t.forward(w*4)
- t.left(91)
- for i in range (50):
- spiral()
Add Comment
Please, Sign In to add comment