04 Try it yourself Interactive
The same 5-row pyramid as section 02. Each press of Next advances one step: most steps print exactly one character, the rest open a row or end it. Three things move together: the row being written, the cell receiving the character, and the line of code responsible for it. Switch to the right triangle to see what disappears when a pattern has no leading spaces.