Advertisement
Guest User

Untitled

a guest
Jan 19th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.70 KB | None | 0 0
  1. # (1) Starting from the point labeled "0", click on each point in ascending order.
  2. # (2) Notice how a fox is being drawn as you add more points.
  3. # (3) Also notice how some points have more than one number label.
  4. # That's it, let's code!
  5.  
  6. app.background = gradient('deepSkyBlue', 'pink', start='top')
  7. Rect(0, 235, 400, 165,
  8. fill=gradient('darkGreen', 'mediumTurquoise', start='bottom'))
  9.  
  10. # Legs, chest, and tail
  11. Polygon(180, 305, 185, 320, 200, 265, 180, 250, fill='orangeRed', border='black')
  12. Polygon(285, 305, 295, 325, 310, 245, 280, 245, fill='orangeRed', border='black')
  13. Polygon(390, 65, 325, 95, 340, 110, 360, 105, 355, 125, 370, 130,
  14. fill='floralWhite', border='black')
  15. Polygon(85, 170, 120, 160, 190, 175, 135, 260, fill='floralWhite', border='black')
  16.  
  17.  
  18. # Define a polygon to add points to.
  19. ### (HINT: only give the fill and border parameters.)
  20. ### Modify Your Code Here ###
  21. connect = Polygon(fill='orangeRed', border='black')
  22.  
  23. # Dots
  24. Circle(190, 175, 3)
  25. Label('0, 9, 25', 195, 165, bold=True, align='left')
  26. Circle(120, 160, 3)
  27. Label('1', 120, 170, bold=True)
  28. Circle(85, 170, 3)
  29. Label('2', 75, 170, bold=True)
  30. Circle(85, 110, 3)
  31. Label('3', 95, 110, bold=True)
  32. Circle(70, 40, 3)
  33. Label('4', 80, 40, bold=True)
  34. Circle(120, 75, 3)
  35. Label('5', 130, 75, bold=True)
  36. Circle(140, 80, 3)
  37. Label('6', 150, 80, bold=True)
  38. Circle(195, 50, 3)
  39. Label('7', 205, 50, bold=True)
  40. Circle(175, 105, 3)
  41. Label('8', 185, 105, bold=True)
  42. Circle(135, 260, 3)
  43. Label('10', 125, 260, bold=True)
  44. Circle(170, 340, 3)
  45. Label('11', 180, 340, bold=True)
  46. Circle(190, 260, 3)
  47. Label('12', 200, 255, bold=True)
  48. Circle(220, 270, 3)
  49. Label('13', 220, 280, bold=True)
  50. Circle(250, 260, 3)
  51. Label('14', 260, 260, bold=True)
  52. Circle(280, 340, 3)
  53. Label('15', 290, 340, bold=True)
  54. Circle(300, 260, 3)
  55. Label('16', 315, 260, bold=True)
  56. Circle(320, 225, 3)
  57. Label('17', 330, 225, bold=True)
  58. Circle(300, 180, 3)
  59. Label('18, 24', 310, 180, bold=True, align='left')
  60. Circle(325, 95, 3)
  61. Label('19', 325, 85, bold=True)
  62. Circle(340, 110, 3)
  63. Label('20', 340, 120, bold=True)
  64. Circle(360, 105, 3)
  65. Label('21', 370, 105, bold=True)
  66. Circle(355, 125, 3)
  67. Label('22', 355, 135, bold=True)
  68. Circle(370, 130, 3)
  69. Label('23', 370, 140, bold=True)
  70.  
  71. # Face
  72. Line(110, 130, 140, 150)
  73. Line(155, 125, 153, 150)
  74. Oval(145, 146, 20, 12)
  75. Circle(110, 108, 12, fill='white')
  76. Circle(115, 108, 6)
  77. Circle(155, 108, 12, fill='white')
  78. Circle(160, 108, 6)
  79.  
  80. def onMousePress(mouseX, mouseY):
  81. # When mouse is pressed add a point to connect the polygon.
  82. ### (HINT: Use the addPoint(x, y) method.)
  83. ### Place Your Code Here ###
  84. connect.addPoint(mouseX, mouseY)
  85.  
  86. # test case:
  87. # This test case is intentionally blank (only calls top-level code)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement