Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import turtle, random
- Pointer = turtle.Turtle()
- Scr = turtle.Screen()
- Scr.bgcolor("black")
- Pointer.speed(-1)
- Pointer.hideturtle()
- Pointer.pensize(2)
- def DrawSquare(Color, Size):
- Pointer.color(Color)
- for n in range (5):
- Pointer.forward(15*Size)
- Pointer.right(180)
- for i in range (5):
- Pointer.forward(5*Size)
- Pointer.right(45)
- def RandomColor():
- Array = [0,0,0,0,0,0]
- Array[0] = random.randint(0,9)
- Array[1] = random.randint(0,9)
- Array[2] = random.randint(0,9)
- Array[3] = random.randint(0,9)
- Array[4] = random.randint(0,9)
- Array[5] = random.randint(0,9)
- Color = "#"
- for ColorUnit in Array:
- Color += str(ColorUnit)
- return Color
- def RandomDraw(x, y):
- Pointer.goto(x, y)
- for i in range (80):
- Color = RandomColor()
- DrawSquare(Color, i)
- Pointer.forward(5)
- Pointer.left(5)
- RandomDraw(0, 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement