Advertisement
KaySawbridge

Rectangle Art?

Jul 17th, 2020
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.74 KB | None | 0 0
  1. tommy = Turtle()
  2. def random_rectangles(name, color,pensize, x, y):
  3.     name.color(color)
  4.     name.pensize(pensize)
  5.     name.goto(x, y)
  6.     name.pendown
  7.     name.forward(100)
  8.     name.right(90)
  9.     name.forward(150)
  10.     name.right(90)
  11.     name.forward(100)
  12.     name.right(90)
  13.     name.forward(150)
  14.     name.pendown
  15.    
  16.    
  17.    
  18.  
  19. random_rectangles(tommy,'green',10, 0, 0)
  20. random_rectangles(tommy,'cyan',5, 15, 0)
  21. random_rectangles(tommy,'magenta',15, 100, 0)
  22. random_rectangles(tommy,'purple',10, -50, 45)
  23. random_rectangles(tommy,'purple', 15,-60, 70)
  24. random_rectangles(tommy,'red',20, 30, 20)
  25. random_rectangles(tommy,'yellow',10, -45, -57)
  26. random_rectangles(tommy,'blue',8, -16, 39)
  27. random_rectangles(tommy,'purple',2, -16, 39)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement