-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path3.5.4 Bubble Wrap 2.0
61 lines (51 loc) · 1.06 KB
/
3.5.4 Bubble Wrap 2.0
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
"""
This code will fill the canvas with light blue circles and highlights.
"""
speed(0)
# This function will draw one row of 10 circles
def draw_circle_row():
for i in range(10):
pendown()
begin_fill()
color("light blue")
circle(20)
end_fill()
make_highlight()
penup()
forward(40)
# This function will move Tracy up one row.
def move_up_a_row():
left(90)
forward(40)
right(90)
backward(400)
# This function will highlight one row of 10 circles
def make_highlight():
penup()
left(90)
forward(10)
right(90)
color("white")
circle(10, 90)
pendown()
circle(10,90)
penup()
right(90)
forward(10)
left(90)
circle(20,180)
#Start position
penup()
setposition(-180,-200)
# Repeat fill circle functions 10 times.
for i in range(10):
draw_circle_row()
move_up_a_row()
# Reset to starting position.
penup()
setposition(-180,-200)
left(90)
#Highlight the circles.
for i in range(10):
make_highlight()
move_up_a_row()