This is the code I used!
let zcor-var -16
let xcor-var 16
repeat 10 [
ask patches [
if pzcor = zcor-var and pxcor <= xcor-var [ set pcolor red ]
set zcor-var (zcor-var + 1)
ifelse xcor-var = 16 [set xcor-var (xcor-var - 10)] [set xcor-var (xcor-var - 2)]
So the zcor-var is keeping track of the height that we are filling in, and the xcor-var is keeping track of how long the stair is going to be. We increase the zcor to get a higher level, and decrease the xcor so that the stairs are incremented.