CodingInvestigation
CodingInvestigation
This story tells the tale of two close friends. In the beginning there are very
close to each other
def background():
pencolor('PaleGreen1')
fillcolor('PaleGreen1')
moveto(-50,-125)
begin_fill()
left(129)
circle(95)
right(129)
end_fill()
begin_fill()
polygon(4,100)
end_fill()
forward(100)
begin_fill()
left(51)
circle(-95)
right(51)
end_fill()
moveto(0,0)
def person(size):
circle(size*6)
right(90)
forward(size*5)
left(90)
forward(size*7)
backward(size*14)
forward(size*7)
right(90)
forward(size*10)
left(30)
forward(size*10)
backward(size*10)
right(60)
forward(size*10)
backward(size*10)
left(30)
backward(size*15)
left(90)
def spiral():
for i in range(500):
penup()
forward(i/2)
if i > 100:
dot(4)
right(86)
def draw_oval(x,y,big_radius,small_radius):
moveto(x,y)
circle(big_radius,90)
circle(small_radius,90)
circle(big_radius,90)
circle(small_radius,90)
#background
pencolor('DodgerBlue')
#spiral background
moveto(0,0)
spiral()
left(160)
#dot background
pensize(2)
pencolor('LightSkyBlue1')
moveto(-200,150)
draw(15,20,27)
#grass hills
background()
#left side
pencolor('LightSalmon4')
pensize(4)
moveto(-150, -75)
#bob
person(2)
moveto(-120, -75)
#jerry
person(2)
#right side
#bob2
moveto(120, -75)
person(2)
#jerry2
moveto(150, -75)
person(2)
pensize(2)
pencolor('green3')
moveto(150,150)
for i in range (180):
moveto(randint(-100,100),randint(0,140))
polygon(randint(3,10),randint(10,15))
#
pencolor('LightSalmon')
draw_oval(-150,40,50,25)
draw_oval(100,100,30,20)
#
pencolor('IndianRed')
moveto(-150, 0)
polygon(3, 20)
moveto(150, 0)
polygon(3, 40)
#
pencolor('OrangeRed')
moveto(-80, 20)
polygon(4, 40)
moveto(80, 20)
polygon(4, 10)
#
pencolor('gray100')
moveto(-70, 50)
circle(15)
moveto(70, 50)
circle(10)