There are multiple ways to approach this, some more elegant than others.
To tackle this problem in a more simple/straightforward way, I would view each drawn pyramid as a variable (user-defined) number of rows with the same number of columns. This makes a block to print to the screen. Ex: (# stands for blank space)
Using this, we know that if we store these blocks by their row lines, we can print them out all at once. Ex.
is made out of
and
However, rather than print one block and then the other, we print the first line of each, and then the next until each pyramid is finished. If one pyramid is smaller than the other, you just continue printing lines of spaces at the column length of that pyramid.
If you want your pyramids on level ground together, you would print empty space on top of the smaller pyramids first.
(This actually feels like a really fun problem!)