Question: Create the flowchart ( thumbs up if you are able to do ! check all 4 images . . . LAST IMAGE HAS EXAMPLE OF

Create the flowchart ( thumbs up if you are able to do! check all 4 images ... LAST IMAGE HAS EXAMPLE OF FLOWCHART)
for i in range(iterations,0,-1):
currentGradient =[
currentGradient[i]+ step[i] for i in range(GRADIENT_SIZE) def dranLightSource():
]
skyTurtle.fillcolor(currentGradient)
skyTurtle.begin_fill()
drawCircleCentered(skyTurtle, radius)
skyTurtle.end_fill()
skyTurtle.setposition(skyTurtle.xcor(), skyTurtle.ycor()=(WIDTH /(iterations *1.30)))
def drawSky():
radius = LIGHT_SOURCE_RADIUS
a Set the turtle to the middle of the screen and bring it up as the day advances
Account for the light source entering and exiting the view
if isDaytime();
lightSourseTurtle.teleport(WIDTH //2,((timeTick / totalTicks)*2.5*(HEIGHT))-(radius *1.25))
else:
This code could definitely be better (the if loop shouldn't need to exist)
lightSourceTurtle.teleport(HIDTH //2,((((timeTick *(totalTicks //2))/ totalticks)*2.5*(HEIGHT))-(radius *1.25)))
a Dram background
dranfackground()
a Dram stars (if night)
if not isDoytime():
dramStars()
Sun/Moon
drawlight5ource()
def redramSky():
radius = LIGHT_SOURCE_RADIUS
a Set the turtle to the middle of the screen and bring it up as the day advances
a Account for the light source entering and exiting the view
if isDaytime():
lightSourseTurtle.teleport(WIDTH //2,((timeTick / totaliticks)*2.5*(HEIGMT))-(radius *1.25))
else:
This code could definitely be better (the if loop shouldn't need to exist)
lightSourceTurtle.teleport(HIDTH //2,(((timeTick -(totalTicks //2))/ totalTicks)*2.5*(HEIGHT))-(radius *1.25))
Dram background
drawfackground()
a Dram stars (if night)
if not isDaytime();
if len(starTurtles)!-0:
updatestars()
else:
dranStars()
= Sun/Moon
drawLightSource()
def dranStars():
starAmount = WIDTH //20
stars =[]
for i in rafge(starAmount):
stars.append(randomStar())
for star in stars:
dramStar(star[01, star[11)
topOfMoon =(lightSourceTurtle.xcor(), lightSourceTurtle.ycor())320 def drawLine(length, turtle):
lightSourceTurtle.pendown()323 turtle.pendoun()
lightSourceTurtle.setheading(180)325 turtle.forward(halfLength)
turtle.backward(length)
turtle.left(180)
turtle.backward(halflength)
lightSourceTurtle.teleport(topOfMoon[0], topOfMoon[1])
lightSourceTurtle.setheading(180) $330 turtle.penup()
lightSourceTurtle.circle(innerWidth1,90)
lightSourceTurtle.circle(innerWidth2,80)
if not wasPenDown:
lightSourceTurtle.penup()
def isDaytime():
return timeTick (totalTicks //2)
def randomstar():
return (random.randint(0, WIDTH), random.randint(HEIGHT //2, HEIGHT))
def updateStars():
for turtle in starTurtles:
x = turtle.xcor()
If x >= wIDTH:
x =0
turtle.setx(x)
turtle.sety(randomstar()[1])
turtle.clear()
drawStar(x +(wIDTH //80), starTurtle-turtle)
def dramStar(x, y=None, starTurtle-None):
If starTurtle is None:
starTurtle = defaultTurtle()
starTurtles.append(starTurtle)
starTurtle.color("yellow")
starTurtle.penup()
starTurtle.goto(x, starTurtle.ycor() if y is None else y)
starTurtle.setheading(90)
drawline(10, starTurtle)
starTurtle.right(45)
374 defaultTurtle(skyTurtle)
starTurtle.left(90)375 defaultTurtle(lightSourceTurtle)
drawLine(10, starTurtle)376 defaultTurtle(buildingTurtle)
starTurtle.left(45)37% setupbilding(buildingTurtle)
drawLine(10, starTurtle)378 defaultTurtle(rectTurtle)
starTurtle.penup()
global window_chance; window_chance = float(entries[8])
global light_on_chance; light_on_chance = float(entries[9])
global window_margin; window_margin = int(entries[10])
global window_gap; window_gap = int(entries[11])
global timeTick; timeTick = int(entries[12])
global totalTicks; totalTicks = int(entries[13])
sleepMilliseconds = float(entries[14])
global showTurtles; showTurtles = showTurtlesBool.get()
master.destroy()
Turtle management
global skyTurtle; skyTurtle = Turtle()
global lightSourceTurtle; lightSourceTurtle = Turtle()
global starTurtles; starTurtles =[]
global buildingTurtle; buildingTurtle = Turtle()
global rectTurtle; rectTurtle = Turtle()
screen = setupScreen()
setupTurtles()
467
468
469 drawSky()
470 drawBuildings(buildingTurtle)
471
472 # Fixes output in console when closed by user
473 try:
474 while True:
475 screen.update()
476 sleep(sleepMilliseconds)
477 tickTime()
478
479 redrawSky()
480 redrawBuildings(buildingTurtle)
481 except TclError:
482 return
483
484
485 if name == "main":
486 main()
Create a Flowchart
(Flowcharts help you catch possible mistakes early on and also let you see if you want to add more
functionality.)
Example:
Delete the above description of Flowcharts and then copy and paste your
Flowchart(s) here, #1:
Create the flowchart ( thumbs up if you are able

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!