Advertisement
kevinbocky

algorithm1.py

Jan 26th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. from turtle import Turtle
  2.  
  3. t = Turtle()
  4. #guess which shap each one is :)
  5. for i in range(3):
  6. t.pendown()
  7. if i <= 0:
  8. t.right(60)
  9. t.forward(100)
  10. else:
  11. t.right(120)
  12. t.forward(100)
  13. t.penup()
  14. t.hideturtle()
  15.  
  16. t.goto(150,150)
  17.  
  18. for i in range(5):
  19. t.pendown()
  20. if i <= 0:
  21. t.right(96)
  22. t.forward(100)
  23. else:
  24. t.right(72)
  25. t.forward(100)
  26. t.penup()
  27. t.hideturtle()
  28.  
  29. t.goto(-150,150)
  30.  
  31. for i in range(5):
  32. t.pendown()
  33. if i <= 0:
  34. t.right(72)
  35. t.forward(100)
  36. else:
  37. t.right(72)
  38. t.forward(100)
  39. t.penup()
  40. t.hideturtle()
  41.  
  42. t.goto(-100,-150)
  43.  
  44. count = 4
  45. for i in range(int(count)):
  46. t.pendown()
  47. if count %2 == 0:
  48. if i <= 0:
  49. t.right(36)
  50. t.forward(200)
  51. t.right(90)
  52. else:
  53. t.forward(200)
  54. t.right(90)
  55. count = count - 1
  56. else:
  57. t.forward(50)
  58. t.right(90)
  59. count = count - 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement