Advertisement
MightyDantheman

Triangle Ring Illusion

Apr 8th, 2020
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. import turtle
  2. turtle.Screen()
  3. loop = 0
  4. lines = 25 #Number of lines drawn
  5. def create(): #Creates a new instance with the following attributes
  6.     new = turtle.Turtle()
  7.     new.speed = 0
  8.     new.shape("triangle")
  9.     new.up()
  10.     return new
  11. for _ in range(lines): #Core loop
  12.     new = create() #Sets variable "new" to the created instance via "create" function
  13.     new.right(loop*360/lines) #Calculates the distance required to rotate based on loop count and total lines
  14.     for _ in range(10): #Sub loop to draw each line
  15.         new.forward(15)
  16.         new.stamp()
  17.     loop = loop + 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement