Question: Make a flowchart that looks like this! with the code in GREEN for adding windows that toggle on / and off on a Skyline building,
Make a flowchart that looks like this! with the code in GREEN for adding windows that toggle onand off on a Skyline building, please use the images to refer too
behind the design of windows!
# Userchangeable variables
backgroundColor #
buildingColor #cee
windowColor #FFFF changed
windowheight Height of a window
windowwidth width of a windlow
windowchance Probability of a building having windows changed e
lightonchance Probability of a window being lit changed e
windowmargin e Margin from edge of building for windows changed e
windowgap Gap between windows changed e
unveilTheCurtain False Whether the user wants to see the turtles
def drawWindowsbuildingTurtle buildingHeight, buildingWidth: # changed
# windowrows random.randint
# windowcolumns random.randint
# windowheight buildingHeight windowmargin windonrows
# windowwidth buildingwidth windowmargin windongap windowcolumns
windowcolumns
# buildingbasey buildingTurtle.ycor buildingHeight
# buildingleftx buildingTurtle.xcor buildingWidth
windowrows buildingHeight windowmargin windowgapwindowheight
windowgap
windowcolumns buildingwidth windowmargin windowgapwindowwidth
windowgap
buildingbasey buildingTurtle.ycor
buildingleftx buildingTurtle.xcor buildingWidth
for row in rangewindowrows:
for col in rangewindowcolumns:
if random.random lightonchance:
x buildingleftx col windowwidth col windowgap
windowmargin
y buildingbasey row windowheight row windowgap
windowmargin
drawRectanglex y windowwidth, windowheight, colorwindowColor
floorwidth random,randintwindowwidth windowmarginWIDTH The
floorwidth should have at least one window.
construct.forwardfloorwidth
return floorWidth
def constructWallconstruct previousWallHeightNone, wallHeightNone:
if previousWallHeight is None:
construct.setheading
wallHeight
random, randintwindowheight windowmargin intHEIGHT if
wallHeight is None else wallHeight The wallHeight should have at least one window,
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 Flowcharts here, #:
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
