Advertisement
Guest User

Untitled

a guest
Sep 1st, 2015
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. from turtle import *
  2. #This is the angle of direction for testing
  3. z = 0
  4. def triangle_sign(s1):
  5. penup()
  6. color('yellow')
  7. goto(0, s1 / 2)
  8. pensize(6)
  9. setheading(240 + z)
  10. pendown()
  11. begin_fill()
  12. forward(s1)
  13. setheading(0+z)
  14. forward(s1)
  15. setheading(120+z)
  16. forward(s1)
  17. end_fill()
  18. penup()
  19. pensize(10)
  20. goto (0, s1 / 2)
  21. color('black')
  22. setheading(240+z)
  23. pendown()
  24. forward(s1)
  25. setheading(0+z)
  26. forward(s1)
  27. setheading(120+z)
  28. forward(s1)
  29. pensize(2)
  30. penup()
  31. setheading(270+z)
  32. forward(s1 * 0.55)
  33. #Draw the big lasers
  34. def big_laser(a1):
  35. penup()
  36. color('black')
  37. pensize(3)
  38. pendown()
  39. setheading(a1+z)
  40. forward(30)
  41. backward(30)
  42. penup()
  43. #Draw the smaller lasers
  44. def small_laser(a2):
  45. penup()
  46. color('black')
  47. pensize(2)
  48. pendown()
  49. setheading(a2+z)
  50. forward(27.5)
  51. backward(27.5)
  52. penup()
  53. def long_laser(a3):
  54. penup()
  55. color('black')
  56. pensize(4)
  57. pendown()
  58. setheading(a3+z)
  59. forward(42.5)
  60. backward(42.5)
  61. penup()
  62. def laser_source(sx):
  63. penup()
  64. color('black')
  65. pensize(2)
  66. setheading(90+z)
  67. backward(22)
  68. setheading(0+z)
  69. begin_fill()
  70. pendown()
  71. circle(22)
  72. end_fill()
  73. #Draw the warning sign sheet
  74. triangle_sign(150)
  75. #Draw the big lasers
  76. big_laser(30)
  77. big_laser(60)
  78. big_laser(90)
  79. big_laser(120)
  80. big_laser(150)
  81. big_laser(180)
  82. big_laser(210)
  83. big_laser(240)
  84. big_laser(270)
  85. big_laser(300)
  86. big_laser(330)
  87. #Draw the smaller lasers
  88. small_laser(15)
  89. small_laser(45)
  90. small_laser(75)
  91. small_laser(105)
  92. small_laser(135)
  93. small_laser(165)
  94. small_laser(195)
  95. small_laser(225)
  96. small_laser(255)
  97. small_laser(285)
  98. small_laser(315)
  99. small_laser(345)
  100. #Draw the long laser that hits the border
  101. long_laser(0)
  102. #Draw the circle in the middle of the lasers
  103. laser_source(150)
  104.  
  105. hideturtle()
  106. done()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement