Advertisement
EmmettMilligan

S Q U A R E

Feb 24th, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. from graphics import*;
  2. import random;
  3.  
  4. window = GraphWin("589 doe",500,500)
  5. window.setBackground("white")
  6.  
  7. for x in range(0,588,3):
  8. x = random.randint(0,500)
  9. y = random.randint(0,500)
  10. x2 = random.randint(0,500)
  11. y2 = random.randint(0,500)
  12. x3 = random.randint(0,500)
  13. y3 = random.randint(0,500)
  14. r1 = Rectangle(Point(x,y),Point(x+25,y+25))
  15. r1.setFill("white")
  16. r1.draw(window)
  17. r2 = Rectangle(Point(x2,y2),Point(x2+25,y2+25))
  18. r2.setFill("grey")
  19. r2.draw(window)
  20. r3 = Rectangle(Point(x3,y3),Point(x3+25,y3+25))
  21. r3.setFill("black")
  22. r3.draw(window)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement