Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask History Expert

So my professor asked us to program a "stick figure" in python turtle, which I did but my program is not working. He wants us to repeat and/or randomize elements from the current "stick figure" program which I don't know how to do. The important thing is that the picture should look different each time you run it and there should be multiple components that change. The whole picture that you created as in turtle can repeat with different settings Parts of a big picture can repeat with different settings, e.g., the whole picture could represent a scene with different random elements. Etc. Like distance, color or position

import turtle

screen = turtle.screen()

screen.setup(500,500)

my_turtle = turtle.Turtle()

#function to draw circle head with radius 50

def draw_head():

 my_turtle.circle(50)

 my_turtle.right(90)

# function to draw torso, lift pen up, then move to middle of torso

def draw_torso():

 my_turtle.forward(150)

 my_turtle.pu()

 my_turtle.backward(75)

 my_turtle.right(135)

# function to put pen down, draw left arm at 45 degrees, then return to middle of torso

def draw_left_arm():

 my_turtle.pd()

 my_turtle.forward(50)

 my_turtle.right(45)

 my_turtle.forward(10)

 my_turtle.pu()

 my_turtle.backward(10)

 my_turtle.left(90)

 my_turtle.pd()

 my_turtle.forward(10)

 my_turtle.pd)

 my_turtle.forward(10)

 my_turtle.pu()

 my_turtle.backward(10)

 my_turtle.left(135)

 my_turtle.forward(50)

 my_turtle(90)

# function to put pen down, draw right arm at 45 degrees, return to middle of torso, turn right 135 dgrees to face down

def draw_right_arm():

 my_turtle.pd()

 my_turtle.forward(50)

 my_turtle.left(45)

 my_turtle.forward(10)

 my_turtle.pu()

 my_turtle.backward(10)

 my_turle.right(90)

 my_turtle.pu()

 my_turtle.backward(10)

 my_turlte.right(135)

 my_turtle.forward(50)

 my_turtle.left(45)

# function to move to bottom of torso, put pen down left leg at 45 dgrees facing, down then lift pen up

def draw_left_leg():

 my_turtle.forward(75)

 my_turtlel.right(45)

 my_turtle.pd()

 my_turtle.forward(50)

 my_turtle.pu()

 my_turtle.backward(50)

# function to return to bottom of torso, put pen down, draw right leg at 45 degrees facing down

def draw_right_leg():

 my_turtle.left(90)

 my_turtle.pd()

 my_turtle.foward(50)

#function that calls all of the above functions

def draw_stick_figure():

 draw_head()

 draw_torso()

 draw_left_arm()

 draw_right_arm()

 draw_left_leg()

 draw_right_leg()

draw_stick_figure()

History, Academics

  • Category:- History
  • Reference No.:- M93134223
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in History

Use the management studio to create a new database called

Use the Management Studio to create a new database called the default settings(If the database already exists, use the Management Studio to delete it and than create it.

Choose at least two sources on the black death these

Choose at least two sources on the Black Death.. These sources may be e-books or articles. Then, write an essay of at least one page on the following topic: Characterize the significance of the Black Death's impacts on t ...

Describe the followers qualities and behaviors that

Describe the follower's qualities and behaviors that contribute to productive and rewarding leader-follower relationships.

Answer the following question bulldescribe how and why

Answer the following Question : •Describe how and why political parties arose. •Explain why Thomas Jefferson thought Alexander Hamilton's economic system "flowed from principles adverse to liberty, and was calculated to ...

This discussion will focus upon comparing romanesque and

This discussion will focus upon comparing Romanesque and Gothic styles. To start this discussion, State University of New York at Albany's Dr. Strum has created a virtual tour of the Cloisters, a branch of the Metropolit ...

Choose one of the five topics to write aboutcompose a two

Choose one of the five topics to write about. Compose a two (2)-page essay in which you will take a first-person perspective of the situation, describe the debate in your own words, and provide a justified and academical ...

What outside resources are available to assist technology

What outside resources are available to assist technology managers in the implementation and maintenance process of IT governances? Outline two resources.

The authors distinguish between controllable and

The authors distinguish between controllable and uncontrollable factors that influence the demand for a product. One of the controllable factors on their list is advertising --- do you agree with this classification? Com ...

Discussiontopic communicating an unchanging gospel message

Discussion Topic: Communicating an Unchanging Gospel Message in a Changing World Thread Prompt: How do the practices of intercultural communication and cultural intelligence provide insight and understanding as we seek t ...

The assign country is vietnamplease follow the instruction

The assign country is Vietnam,please follow the instruction below, no plagiarism, and use simple word. What to Write? Food is fundamental to life. As a result, whether we realize it or not, food has been a major catalyst ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As