Advertisement
jukaukor

kasvi.py

Jun 18th, 2019
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. # kasvitiedettä...;-)
  2. # Juhani Kaukoranta
  3. # 18.6.2019
  4.  
  5. from turtle import *
  6. speed(0)
  7. def kuvio(x,y,haarat,pituus):
  8. setposition(x,y)
  9. hideturtle()
  10. for i in range(1,haarat+1):
  11. pencolor("blue")
  12. pensize(2)
  13. fd(pituus)
  14. x0 = xcor()
  15. y0 = ycor()
  16. for i in range(1,haarat+2):
  17. pencolor("magenta")
  18. pensize(1)
  19. setposition(x0,y0)
  20. fd(25)
  21. rt(360/(haarat+1))
  22. penup()
  23. setposition(x,y)
  24. rt(360/haarat)
  25. pendown()
  26.  
  27. setposition(0,0)
  28. for i in range (1,9):
  29. pendown()
  30. pencolor("red")
  31. pensize(3)
  32. fd(225)
  33. lt(60)
  34. x1 = xcor()
  35. y1 = ycor()
  36. kuvio(x1,y1,10,75)
  37. penup()
  38. pencolor("red")
  39. setposition(0,0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement