How would you draw a triangle in notepad?
the top and bottom rows are unique: the top row writes 1 * and the bottom row writes several.
All the other rows will write 2, in a repeating pattern of write N-v spaces, write *, write v spaces, write * .. a loop. Play with the spaces written and you will get different looking triangles.
the last line is the same logic as the loop except the inner spaces are * instead of space.
The first line can be thought of as logically the same (write spaces, write *, write 0/nothing, write *) but you can't write nothing and over-write your *, so you have to code it differently.
A diamond removes the bottom row and reverses the pattern at some point, and the last row is like the first row, writing just 1 *
(by the way it is possible to write the entire thing in a single loop but on your first try it will be easier to make the special rows distinct).