TonyMo

1_8_abeturtspiral.py

Mar 20th, 2021 (edited)
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.96 KB | None | 0 0
  1. # 1 8 abeturtspiral.py
  2.  
  3. from turtle import Turtle
  4.  
  5. abe = Turtle()
  6.  
  7. # abe.dot(100)
  8.  
  9. # use radius
  10. def draw_circle(name, r, color):
  11.     name.color(color)
  12.     name.dot(r*2)
  13.  
  14. # move the start point
  15. abe.penup()
  16. abe.goto(-100, 100) # HMMM? how to move the whole spiral?
  17. abe.pendown()
  18. draw_circle(abe,5, "red")
  19. abe.penup()
  20. abe.goto(0, 0)
  21. abe.pendown()
  22. # archimedes
  23. draw_circle(abe,5, "green") # starts at 0,0
  24.  
  25. '''
  26. abe.goto( 0, 0)
  27. draw_circle(abe,2, "red")'''
  28.  
  29. abe.goto( 2, 15)
  30. draw_circle(abe,5, "green")
  31.  
  32. abe.goto( 10, 30)
  33. draw_circle(abe,5, "green")
  34.  
  35. abe.goto( 22, 40)
  36. draw_circle(abe,5, "green")
  37.  
  38. abe.goto( 38, 50)
  39. draw_circle(abe,5, "green")
  40.  
  41. abe.goto( 60, 60)
  42. draw_circle(abe,5, "green")
  43.  
  44. abe.goto( 90, 60)
  45. draw_circle(abe,5, "green")
  46.  
  47. abe.goto( 120, 50)
  48. draw_circle(abe,5, "green")
  49.  
  50. abe.goto( 150, 30)
  51. draw_circle(abe,5, "green")
  52.  
  53. abe.goto( 180, 0)
  54. draw_circle(abe,5, "green")
  55.  
  56. abe.goto( 205, -40)
  57. draw_circle(abe,5, "green")
  58.  
Add Comment
Please, Sign In to add comment