Advertisement
tilahun1

test

Jul 5th, 2022
761
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from cs1graphics import *
  2. paper = Canvas(300, 200, 'skyBlue', 'My World')
  3. sun = Circle(30, Point(250,50))
  4. sun.setFillColor('yellow')
  5. paper.add(sun)
  6. facade = Square(60, Point(140,130))
  7. facade.setFillColor('white')
  8. paper.add(facade)
  9. chimney = Rectangle(15, 28, Point(155,85))
  10. chimney.setFillColor('red')
  11. chimney.setBorderColor('red')
  12. paper.add(chimney)
  13. tree = Polygon(Point(50,80), Point(30,140), Point(70,140))
  14. tree.setFillColor('darkGreen')
  15. paper.add(tree)
  16. smoke = Path(Point(155,70), Point(150,65), Point(160,55), Point(155,50))
  17. paper.add(smoke)
  18. sunraySW = Path(Point(225,75), Point(210,90))
  19. sunraySW.setBorderColor('yellow')
  20. sunraySW.setBorderWidth(6)
  21. paper.add(sunraySW)
  22. sunraySE = Path(Point(275,75), Point(290,90))
  23. sunraySE.setBorderColor('yellow')
  24. sunraySE.setBorderWidth(6)
  25. paper.add(sunraySE)
  26. sunrayNE = Path(Point(275,25), Point(290,10))
  27. sunrayNE.setBorderColor('yellow')
  28. sunrayNE.setBorderWidth(6)
  29. paper.add(sunrayNE)
  30. sunrayNW = Path(Point(225,25), Point(210,10))
  31. sunrayNW.setBorderColor('yellow')
  32. sunrayNW.setBorderWidth(6)
  33. paper.add(sunrayNW)
  34. grass = Rectangle(300, 80, Point(150,160))
  35. grass.setFillColor('green')
  36. grass.setBorderColor('green')
  37. grass.setDepth(75) # must be behind house and tree
  38. paper.add(grass)
  39. window = Rectangle(15, 20, Point(130,120))
  40. paper.add(window)
  41. window.setFillColor('black')
  42. window.setBorderColor('red')
  43. window.setBorderWidth(2)
  44. window.setDepth(30)
  45. roof = Polygon(Point(105, 105), Point(175, 105), Point(170,85), Point(110,85))
  46. roof.setFillColor('darkgray')
  47. roof.setDepth(30) # in front of facade
  48. chimney.setDepth(20) # in front of roof
  49. paper.add(roof)
  50.  
Advertisement
RAW Paste Data Copied
Advertisement