Python and Turtle Graphics
####Pattern 4 step = 100 length = 100 angle = 120 def drawSquare(length,turn): for i in range (0,step): for b in range (0,2): turtle.forward(length+i*2) turtle.right(angle+b) |
####Pattern 3 step = 100 length = 100 angle = 90 def drawSquare(length,turn): for i in range (0,step): for b in range (0,2): turtle.forward(length+i*2) turtle.right(angle+b) |
####Pattern 2 step = 100 length = 100 for x in range (0,2): angle = x*100 def drawSquare(length,turn): for i in range (0,step): for b in range (0,2): turtle.forward(length+i*2) turtle.right(angle+b) |
####Pattern 1 step = 100 length = 100 angle = 90 def drawSquare(length,turn): for i in range (0,step): for b in range (0,4): turtle.forward(length+i) turtle.right(angle+b) |