Skip to content

Commit ab05540

Browse files
author
DirDraggo
committed
Added the code
added lesson 13 to 17
1 parent d161ea5 commit ab05540

7 files changed

+133
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
speed(5)
2+
penup()
3+
setposition(-140, 0)
4+
pendown()
5+
def caterpillar(color_choice):
6+
color(color_choice)
7+
begin_fill()
8+
circle(20)
9+
end_fill()
10+
penup()
11+
forward(40)
12+
pendown()
13+
for i in range(8):
14+
color_choice=input("Pick a color: ")
15+
caterpillar(color_choice)
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
speed(0)
2+
penup()
3+
radius=int(input("Choose a radius: "))
4+
def make_circle_in_a_square(radius):
5+
setposition(0-radius, 0-radius)
6+
color("red")
7+
begin_fill()
8+
for i in range(4):
9+
pendown()
10+
forward(radius*2)
11+
left(90)
12+
end_fill()
13+
penup()
14+
forward(radius)
15+
color("blue")
16+
pendown()
17+
begin_fill()
18+
circle(radius)
19+
end_fill()
20+
make_circle_in_a_square(radius)

CodeHS/2/13/6/Snowman-Travis.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
speed(0)
2+
penup()
3+
setposition(0,-200)
4+
radius=int(input("Radius of bottom snowball?: "))
5+
def make_snowman(radius):
6+
color("gray")
7+
make_circle(1)
8+
nav(2)
9+
make_circle(2)
10+
nav(1)
11+
make_circle(4)
12+
def nav(mult):
13+
left(90)
14+
forward(radius * mult)
15+
right(90)
16+
def make_circle(div):
17+
begin_fill()
18+
circle(radius / div)
19+
end_fill()
20+
make_snowman(radius)

CodeHS/2/14/4/Geometry-2.0-Travis.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
speed(0)
2+
penup()
3+
setposition(0,-150)
4+
add=0
5+
radius=20
6+
for i in range(7):
7+
pendown()
8+
circle(radius + add, 360, i)
9+
add = add + 20
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
speed(0)
2+
radius = 25
3+
circle(radius)
4+
for i in range(3):
5+
penup()
6+
right(90)
7+
forward(25)
8+
left(90)
9+
pendown()
10+
radius = radius + 25
11+
circle(radius)

CodeHS/2/15/5/Phone-Signal-Travis.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""
2+
Used `j` to differ from `i`
3+
"""
4+
speed(0)
5+
for i in range(10, 51, 10):
6+
for j in range(2):
7+
forward(10)
8+
left(90)
9+
forward(i)
10+
left(90)
11+
penup()
12+
forward(35)
13+
pendown()

CodeHS/2/16/4/Happy-Face-Travis.py

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
speed(0)
2+
penup()
3+
4+
happy=input("Are you happy? (yes,no): ")
5+
6+
def make_eye():
7+
color("black")
8+
pendown()
9+
begin_fill()
10+
circle(20)
11+
end_fill()
12+
penup()
13+
14+
def make_smiley():
15+
##FACE
16+
setposition(0,-100)
17+
color("yellow")
18+
pendown()
19+
begin_fill()
20+
circle(100)
21+
end_fill()
22+
penup()
23+
24+
##MOUTH
25+
setposition(0,-70)
26+
pensize(10)
27+
color("black")
28+
pendown()
29+
circle(60,90)
30+
color("yellow")
31+
circle(60,180)
32+
color("black")
33+
circle(60,90)
34+
penup()
35+
36+
##EYES
37+
setposition(-30,25)
38+
make_eye()
39+
forward(70)
40+
make_eye()
41+
42+
43+
44+
if happy == "yes":
45+
make_smiley()

0 commit comments

Comments
 (0)