Deviopath › Karel

Staircase of Towers

Hard · Variables

Build a staircase across the whole bottom row: a tower of 1 ball in column 1, a tower of 2 balls in column 2, 3 balls in column 3, and so on until the east wall. Each tower is one ball per square, stacked straight up.

Your code runs in rooms of different widths, so keep the next tower height in a variable.

Next: Measure the Room