daily pastebin goal
16%
SHARE
TWEET

OOP 1_8 Drawing Shapes

Pedroleon Feb 20th, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # 1_8   challenge -  SHAPES
  2. import shapes
  3. from shapes import Triangle, Oval, Rectangle, Paper
  4.  
  5. oval1 = Oval()
  6. oval1.set_height(700)
  7. oval1.set_width(700)
  8. oval1.set_x(5)
  9. oval1.set_y(5)
  10. oval1.set_color("red")
  11. oval1.draw()
  12.  
  13. oval2 = Oval()
  14. oval2.randomize()
  15. oval2.draw()
  16.  
  17. shapel =  []
  18.  
  19. for c in range (90):
  20.     add_shape= shapes.Triangle()
  21.     add_shape.randomize()
  22.     shapel.append(add_shape)
  23. for a in range (50):
  24.     add_shape=shapes.Rectangle()
  25.     add_shape.randomize(30, 80)
  26.     shapel.append(add_shape)
  27.  
  28. for b in range (60):
  29.     add_shape = shapes.Oval()
  30.     add_shape.randomize(40,100)
  31.     shapel.append(add_shape)
  32. for aa in range(300):
  33.     add_shape= shapes.Rectangle()
  34.     add_shape.randomize(5,40)
  35.     shapel.append(add_shape)
  36. for c in range (300):
  37.     add_shape = shapes.Oval()
  38.     add_shape.randomize(10 , 40)
  39.     shapel.append(add_shape)
  40.  
  41.    
  42. for shape in shapel:
  43.     shape.draw()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top