Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.92 KB | None | 0 0
  1. import random, turtle
  2.  
  3. speed(0)
  4.  
  5. def large_mountain():
  6. penup()
  7. setposition(-125,0)
  8. pendown()
  9. begin_fill()
  10. color("#c6ccc6")
  11. pensize(10)
  12. while ycor() <= 150:
  13. length=random.randint(5,15)
  14. angle=random.randint(40,45)
  15. left(angle)
  16. forward(length)
  17. right(angle)
  18. if ycor() >= 150:
  19. break
  20.  
  21. while ycor() >= 0:
  22. pensize(1)
  23. color("#878c88")
  24. length=random.randint(5,15)
  25. angle=random.randint(40,45)
  26. right(angle)
  27. forward(length)
  28. left(angle)
  29. if ycor() <= 0:
  30. break
  31. end_fill()
  32.  
  33. def small_long_mountain():
  34. penup()
  35. setposition(-75,0)
  36. pendown()
  37. begin_fill()
  38. pensize(10)
  39. color("#6d8f6d")
  40. while ycor() <= 50:
  41. length=random.randint(5,10)
  42. angle=random.randint(35,40)
  43. left(angle)
  44. forward(length)
  45. right(angle)
  46. if ycor() >= 50:
  47. break
  48. while ycor() >= 0:
  49. pensize(1)
  50. color("#5b6e5f")
  51. length=random.randint(5,10)
  52. angle=random.randint(35,40)
  53. right(angle)
  54. forward(length)
  55. left(angle)
  56. if ycor() <= 0:
  57.  
  58. break
  59.  
  60. end_fill()
  61.  
  62. def small_mountains():
  63. pendown()
  64. begin_fill()
  65. pensize(10)
  66. color("#a9c2a9")
  67. while ycor() <= 50:
  68. length=random.randint(5,10)
  69. angle=random.randint(48,52)
  70. left(angle)
  71. forward(length)
  72. right(angle)
  73. if ycor() >= 50:
  74. break
  75. while ycor() >= 30:
  76. color("#a9c2a9")
  77. length=random.randint(5,10)
  78. angle=random.randint(48,52)
  79. right(angle)
  80. forward(length)
  81. left(angle)
  82. if ycor() <= 30:
  83. break
  84. while ycor() <= 75:
  85. color("#a9c2a9")
  86. length=random.randint(5,10)
  87. angle=random.randint(48,52)
  88. left(angle)
  89. forward(length)
  90. right(angle)
  91. if ycor() >= 75:
  92. break
  93. while ycor() >= 0:
  94. color("#6e8a73")
  95. pensize(1)
  96. color("#6e8a73")
  97. length=random.randint(5,10)
  98. angle=random.randint(48,52)
  99. right(angle)
  100. forward(length)
  101. left(angle)
  102. if ycor() <= 0:
  103. break
  104. end_fill()
  105.  
  106. def large_mountain_flipped():
  107. penup()
  108. setposition(-125,-10)
  109. pendown()
  110. begin_fill()
  111. color("#c6ccc6")
  112. pensize(10)
  113. while ycor() >= -150:
  114. length=random.randint(5,15)
  115. angle=random.randint(40,45)
  116. right(angle)
  117. forward(length)
  118. left(angle)
  119. if ycor() >= 150:
  120. break
  121.  
  122. while ycor() <= -10:
  123. pensize(1)
  124. color("#878c88")
  125. length=random.randint(5,15)
  126. angle=random.randint(40,45)
  127. left(angle)
  128. forward(length)
  129. right(angle)
  130. if ycor() >= -10:
  131. break
  132. end_fill()
  133.  
  134.  
  135. def small_long_mountain_flipped():
  136. penup()
  137. setposition(-75,-10)
  138. pendown()
  139. begin_fill()
  140. pensize(10)
  141. color("#6d8f6d")
  142. while ycor() >= -60:
  143. length=random.randint(5,10)
  144. angle=random.randint(35,40)
  145. right(angle)
  146. forward(length)
  147. left(angle)
  148. if ycor() <= -60:
  149. break
  150. while ycor() <= -10:
  151. color("#5b6e5f")
  152. pensize(1)
  153. length=random.randint(5,10)
  154. angle=random.randint(35,40)
  155. left(angle)
  156. forward(length)
  157. right(angle)
  158. if ycor() >= -10:
  159. break
  160. end_fill()
  161.  
  162. def small_mountains_flipped():
  163. pendown()
  164. begin_fill()
  165. pensize(10)
  166. color("#a9c2a9")
  167. while ycor() >= -60:
  168. length=random.randint(5,10)
  169. angle=random.randint(48,52)
  170. right(angle)
  171. forward(length)
  172. left(angle)
  173. if ycor() <= -60:
  174. break
  175. while ycor() <= -40:
  176. length=random.randint(5,10)
  177. angle=random.randint(48,52)
  178. left(angle)
  179. forward(length)
  180. right(angle)
  181. if ycor() >= -40:
  182. break
  183. while ycor() >= -85:
  184. length=random.randint(5,10)
  185. angle=random.randint(48,52)
  186. right(angle)
  187. forward(length)
  188. left(angle)
  189. if ycor() <= -85:
  190. break
  191. while ycor() <= -10:
  192. color("#6e8a73")
  193. pensize(1)
  194. length=random.randint(5,10)
  195. angle=random.randint(48,52)
  196. left(angle)
  197. forward(length)
  198. right(angle)
  199. if ycor() >= -10:
  200. break
  201. end_fill()
  202.  
  203. def complete_mountain_and_reflection():
  204. large_mountain()
  205. small_long_mountain()
  206. small_mountains()
  207. penup()
  208. home()
  209. pendown()
  210. large_mountain_flipped()
  211. small_long_mountain_flipped()
  212. small_mountains_flipped()
  213.  
  214. complete_mountain_and_reflection()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement