Like kaud said, you need to devise the mathematical formulas that calculate the number of stars and blanks for any given row number.

When you have done that, it will be easy to deploy a few loops...