Advertisement
EXTREMEXPLOIT

Random Draw #2

Jul 24th, 2019
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.95 KB | None | 0 0
  1. import turtle, random
  2.  
  3. Pointer = turtle.Turtle()
  4. Scr = turtle.Screen()
  5. Scr.bgcolor("black")
  6. Pointer.speed(-1)
  7. Pointer.hideturtle()
  8. Pointer.pensize(2)
  9.  
  10. def DrawSquare(Color, Size):
  11.     Pointer.color(Color)
  12.     for n in range (5):
  13.         Pointer.forward(15*Size)
  14.         Pointer.right(180)
  15.         for i in range (5):
  16.             Pointer.forward(5*Size)
  17.             Pointer.right(45)
  18.  
  19. def RandomColor():
  20.     Array = [0,0,0,0,0,0]
  21.     Array[0] = random.randint(0,9)
  22.     Array[1] = random.randint(0,9)
  23.     Array[2] = random.randint(0,9)
  24.     Array[3] = random.randint(0,9)
  25.     Array[4] = random.randint(0,9)
  26.     Array[5] = random.randint(0,9)
  27.     Color = "#"
  28.     for ColorUnit in Array:
  29.         Color += str(ColorUnit)
  30.     return Color
  31.  
  32. def RandomDraw(x, y):
  33.     Pointer.goto(x, y)
  34.     for i in range (80):
  35.         Color = RandomColor()
  36.         DrawSquare(Color, i)
  37.         Pointer.forward(5)
  38.         Pointer.left(5)
  39.  
  40. RandomDraw(0, 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement