Skip to content

Commit 01e4a72

Browse files
authored
Merge pull request #3 from CRTC-Computer-Engineering/Travis-branch
Did some Ctrl+C && Ctrl+V
2 parents 37acbe3 + ab05540 commit 01e4a72

9 files changed

+217
-0
lines changed
Lines changed: 15 additions & 0 deletions
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)
Lines changed: 20 additions & 0 deletions
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

Lines changed: 20 additions & 0 deletions
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)
Lines changed: 9 additions & 0 deletions
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
Lines changed: 11 additions & 0 deletions
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)
Lines changed: 13 additions & 0 deletions
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

Lines changed: 45 additions & 0 deletions
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()
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
speed(0)
2+
penup()
3+
backward(120)
4+
5+
sqr_size=30
6+
def black_and_white_squares():
7+
accum=0
8+
for i in range(3):
9+
if accum%2==0:
10+
make_black_square()
11+
forward_buffer()
12+
make_white_square()
13+
forward_buffer()
14+
accum=accum+2
15+
def make_white_square():
16+
for i in range(4):
17+
pendown()
18+
forward(sqr_size)
19+
left(90)
20+
def make_black_square():
21+
begin_fill()
22+
for i in range(4):
23+
pendown()
24+
forward(sqr_size)
25+
left(90)
26+
end_fill()
27+
def forward_buffer():
28+
penup()
29+
forward(sqr_size+10)
30+
pendown()
31+
black_and_white_squares()
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
speed(0)
2+
penup()
3+
pensize(10)
4+
happy=input("Are you happy? (yes,no): ")
5+
## Make a smile based on 0,0
6+
def make_smile():
7+
setposition(0,-70)
8+
color("black")
9+
pendown()
10+
circle(60,90)
11+
color("yellow")
12+
circle(60,180)
13+
color("black")
14+
circle(60,90)
15+
penup()
16+
## Make a frown based on 0,0
17+
def make_frown():
18+
penup()
19+
setposition(0,-120)
20+
circle(60,90)
21+
color("black")
22+
pendown()
23+
circle(60,180)
24+
penup()
25+
## Makes a circle and fills it
26+
def make_eye():
27+
color("black")
28+
pendown()
29+
begin_fill()
30+
circle(20)
31+
end_fill()
32+
penup()
33+
## navigation
34+
setposition(0,-100)
35+
color("yellow")
36+
pendown()
37+
begin_fill()
38+
circle(100)
39+
end_fill()
40+
penup()
41+
## Code branches to see if `happy` or `sad`
42+
if happy == "yes":
43+
make_smile()
44+
elif happy == "no":
45+
make_frown()
46+
penup()
47+
setposition(0,0)
48+
left(90)
49+
## Final Navigation
50+
setposition(-30,25)
51+
make_eye()
52+
forward(70)
53+
make_eye()

0 commit comments

Comments
 (0)