Build a Pyramid
Hard · Nested Loops
Build a pyramid of balls. The bottom row is completely full. Each row above it is two squares shorter, with one square less on each side, until the top row has a single ball in the middle.
Your code runs in rooms of different sizes. The room is always an odd number of squares wide and exactly tall enough for the pyramid.
Hint: measure the width first, and keep the length of the current row in a variable.
Next: Reverse the Row