-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathmyturtles.py
More file actions
41 lines (32 loc) · 843 Bytes
/
Copy pathmyturtles.py
File metadata and controls
41 lines (32 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from turtle import *
shape('turtle')
speed(0) #this line makes the turtle go faster
def square(sidelength=100):
for i in range(4):
forward(sidelength)
right(90)
def triangle(sidelength = 100):
for i in range(3):
forward(sidelength)
right(120)
def polygon(sides,sidelength = 100):
for i in range(sides):
forward(sidelength)
right(360/sides)
def squareCircle():
'''Draws a circle of squares'''
for i in range(60):
square(200)
right(5)
def star(sidelength = 200):
for i in range(5):
forward(sidelength)
right(144)
def starSpiral():
length = 5
for i in range(60):
star(length)
length += 5
rt(5)
#call the function you want to execute here:
starSpiral()