-
Notifications
You must be signed in to change notification settings - Fork 0
/
turtleaddon.py
70 lines (63 loc) · 1.38 KB
/
turtleaddon.py
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Turtle Addon
from turtle import *
'''
Name of function: square()
Parameters: pen_color, fill_color, size
Return Value:
What it does:
'''
def square(pen_color, fill_color, size):
pencolor(pen_color)
fillcolor(fill_color)
begin_fill()
for i in range(4):
pendown()
forward(size)
right(90)
end_fill()
'''
Name of funcation: shape()
Parameters: pen_color, fill_color, sides, size
Return Value:
What it does:
'''
def shape(pen_color, fill_color, sides, size):
pencolor(pen_color)
fillcolor(fill_color)
begin_fill()
for i in range(sides):
forward(size)
right(360/sides)
end_fill()
'''
Name of funcation: rectange()
Parameters: pen_color, fill_color, width, length
Return Value:
What it does:
'''
def rectange(pen_color, fill_color, width, length):
pencolor(pen_color)
fillcolor(fill_color)
begin_fill()
forward(length)
right(90)
forward(width)
right(90)
forward(length)
right(90)
forward(width)
end_fill()
'''
Name of funcation: triangle()
Parameters: pen_color, fill_color, length
Return Value:
What it does:
'''
def triangle(pen_color, fill_color, length):
pencolor(pen_color)
fillcolor(fill_color)
begin_fill()
for i in range(3):
forward(length)
right(45)
end_fill()