Watch a rhombus print in stars: n stars on every row, each row starting one column further left, from one nested loop.
About this algorithm
The rhombus prints n stars on every row, and each row starts one column further left than the row above, so the block of stars leans like a parallelogram.
Try it after the mirrored triangle. Both start each row at column n - 1 - i; the rhombus then stops after a fixed n stars instead of running to the edge. It is the first pattern where the start moves but the length does not.
n rows and 2n - 1 columns.
Row i starts at column n - 1 - i: the top row is pushed furthest right, the last row starts at the left edge.
A cell is a star when n - 1 - i <= j < 2n - 1 - i, which is exactly n columns.
A 4 by 7 grid. Each row has four stars, starting at columns 3, 2, 1 and 0. That is 16 stars and 12 spaces in 28 cells.
This page prints the spaces after the stars too, so every row is 2n - 1 wide and you can watch the loop visit them. A program that only has to look right can stop the row after its last star.
Start row i at column i instead, with the test i <= j < i + n, and the rhombus leans to the right.
Time: every cell of the n by (2n - 1) grid gets one test, about 2n² in total. Space: the two bounds are worked out from i and n for each row.