Exerpad
🔥 0
0 XP
Exercise 4 · Chapter: Your First FrameRequired+50 XP

A Line Down

Same idea, turned ninety degrees.

Draw a green line straight down column 20, from the top of the sky all the way through the dirt at the bottom.

Compare your two loops when you're done. In the last exercise the row was fixed and the column moved. Here the column is fixed and the row moves. Which index you loop over is the whole difference between a horizontal line and a vertical one.

Expected output
....................A...................
....................A...................
....................A...................
....................A...................
....................A...................
....................A...................
....................A...................
....................A...................
....................A...................
....................A...................
....................A...................
....................A...................
....................A...................
####################A###################
Need a hint?
3 available · costs 5 XP each
python
def draw(state):
grid = blank_grid()
# Loop over every row and paint column 20 green.
return grid