Advertisement
Guest User

CARE Art Design in Python

a guest
Feb 28th, 2020
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.93 KB | None | 0 0
  1. from turtle import * # imports the module turtle,
  2.                     #* stands for all, which makes things easier
  3.  
  4. speed(0) # sets the speed of drawing to 0, which is the fastest
  5. pencolor('blue') # sets the color of the pen/lines to white
  6.  
  7.  
  8. x = 0 # creates a variable x with value 0
  9. up() # lifts up the pen, so no lines are drawn
  10.  
  11. #note fd() means move forward, bk() means move back
  12. # rt() or lt() means tilt right by a certain angle
  13.  
  14. rt(45)
  15. fd(90)
  16. rt(135)
  17.  
  18. down() # sets down the pen, so that turtle can draw
  19. while x < 120: # while the value of x is lesser than 120,
  20.                 #continuously do this:
  21.     fd(200)    
  22.     rt(61)
  23.     fd(200)
  24.     rt(61)
  25.     fd(200)
  26.     rt(61)
  27.     fd(200)
  28.     rt(61)
  29.     fd(200)
  30.     rt(61)
  31.     fd(200)
  32.     rt(61)
  33.  
  34.     rt(11.1111)
  35.     x = x+1 # adds 1 to the value of x,
  36.             # so that it is closer to 120 after every loop
  37.  
  38. exitonclick() # When you click, turtle exits.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement