Question: Create a flowchart with this python code for the window function! Here is the python code to convert into flowchart below! window _ height =

Create a flowchart with this python code for the window function!
Here is the python code to convert into flowchart below!
window_height =16 # Height of a window
window_width =20 # Width of a window
window_chance =0.7 # Probability of a building having windows (changed 10/28/2024)
window_chance =0.7 # Probability of a building having windows (changed 10/28/2024)
light_on_chance =0.5 # Probability of a window being lit (changed 10/28/2024)
light_on_chance =0.5 # Probability of a window being lit (changed 10/28/2024)
window_margin =5 # Margin from edge of building for windows (changed 10/28/2024)
window_margin =30 # Margin from edge of building for windows (changed 10/28/2024)
window_gap =3 # Gap between windows (changed 10/28/2024)
window_gap =15 # Gap between windows (changed 10/28/2024)
# window_rows = random.randint(10,15)
window_columns = random.randint(1,7)
# window_columns = random.randint(1,7)
window_height =(buildingHeight -2* window_margin)/ window_rows
# window_height =(buildingHeight -2* window_margin)/ window_rows
window_width =(buildingWidth -2* window_margin - window_gap *(window_columns -1))/ window_columns
# window_width =(buildingWidth -2* window_margin - window_gap *(window_columns -1))/ window_columns
building_base_y = buildingTurtle.ycor()- buildingHeight
# building_base_y = buildingTurtle.ycor()- buildingHeight
building_left_x = buildingTurtle.xcor()- buildingWidth /2
# building_left_x = buildingTurtle.xcor()- buildingWidth /2
window_rows =(buildingHeight -2* window_margin + window_gap)//(window_height + window_gap)
window_columns =(buildingWidth - window_margin + window_gap)//(window_width + window_gap)
building_base_y = buildingTurtle.ycor()
building_left_x = buildingTurtle.xcor()- buildingWidth
x = building_left_x + col * window_width +(col -1)* window_gap + window_margin
y = building_base_y + row * window_height + window_margin
y = building_base_y + row * window_height +(row -1)* window_gap + window_margin
drawRectangle(x, y, window_width, window_height *0.8, color=windowColor)
drawRectangle(x, y, window_width, window_height, color=windowColor)
floorWidth = random.randint((window_width +2*window_margin),(WIDTH //6)) # The floorWidth should have at least one window.
random.randint((window_height +2*window_margin), int(HEIGHT /1.5)) if wallHeight is None else wallHeight # The wallHeight should have at least one window.
Looking forward to the flowchart! Make sure it is only drawing the windows part of the program and have a 'start' and 'end' for the flowchart.

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!