Question: i have assignment i have to this: Write a function called figure _ row ( x , y , n ) that draws a horizontal
i have assignment i have to this: Write a function called figurerowx y n that draws a horizontal line of n stick figures. Draw the first stick figure at x y and the others to the right of it at equallyspaced intervals. Don't let the figures overlap or go off the screen.Write a function called figurerowx y n that draws a horizontal line of n stick figures. Draw the first stick figure at x y and the others to the right of it at equallyspaced intervals. Don't let the figures overlap or go off the screen.
x y should be either the bottomleft or bottomright corner of the row of stick figures.
Note that there is no size parameter passed to figurerow. Draw stick figures of size so at least of them can fit on the screen without going off the screen.
this is what i have:
def figurerowx y n:
for i in rangen:
size
radius
ajumptox i y
aeyeradius
turtle.fillcolorwhite
turtle.beginfill
turtle.circleradius
turtle.endfill
turtle.fillcolorblack
turtle.beginfill
turtle.circleradius
turtle.endfill
adrawhappysize
ajumptox y
turtle.pendown
turtle.setheading
turtle.circlesize
turtle.penup
adrawsadsize
turtle.pendown
turtle.setheading
turtle.circlesize
turtle.penup
adrawsurprisedsize
turtle.pendown
turtle.setheading
turtle.circlesize
turtle.penup
adrawneutralsize
turtle.pendown
turtle.gotosize
turtle.forwardsize
turtle.penup
adraweyessize
turtle.penup
turtle.gotosize size
turtle.pendown
aeyesize
turtle.penup
turtle.gotosize size
turtle.pendown
aeyesize
turtle.penup
anosesize
turtle.pensizesize
turtle.penup
turtle.goto size
turtle.pendown
turtle.setheading
turtle.forwardsize
turtle.left
turtle.forwardsize
turtle.penup
return turtle.position
aheadsize
headcolor random.choicered 'blue', 'green', 'yellow', 'purple', 'orange'
turtle.fillcolorheadcolor
# Draw the head circle
turtle.penup
turtle.gotosize
turtle.pendown
turtle.beginfill
turtle.circlesize
turtle.endfill
turtle.penup
# Draw eyes
draweyessize
# Draw nose
nosepos nosesize
# Draw mouth
turtle.gotonosepos nosepos size
turtle.setheading
mouthstyles happy 'sad', 'surprised', 'neutral'
selectedmouth random.choicemouthstyles
if selectedmouth 'happy':
drawhappysize
elif selectedmouth 'sad':
drawsadsize
elif selectedmouth 'surprised':
drawsurprisedsize
else:
drawneutralsize
abodysize
# Draw the body
turtle.penup
turtle.gotosize
turtle.pendown
turtle.gotosize
turtle.penup
aarmsarmsize
# Draw the arms
turtle.gotosize
turtle.pendown
turtle.gotosize, size
turtle.penup
turtle.gotosize
turtle.pendown
turtle.gotosizesize
turtle.penup
alegssize
# Draw the legs
turtle.gotosize
turtle.pendown
turtle.gotosize size
turtle.penup
turtle.gotosize
turtle.pendown
turtle.gotosize size
turtle.penup
astickfiguresize
headsize
bodysize
armssize
legssize
def drawmultiplerowsstartx starty rows, figuresperrow:
verticalspacing
for i in rangerows:
yposition starty i verticalspacing
figurerowstartx yposition, figuresperrow
apyturtle.penup
aturtle.gotox Y
turtle.setheading
turtle.pendown
astickfiguresize
turtle.speed
turtle.hideturtle
turtle.done
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
