I know this thread is outdated, but you know, 2 cents.
I am not sure on the code right now, but what you need to do is realize the difference between printing just one of those triangles out, stacked on top of each other, and having them all lined up. You need a starting loop that is going to define how many total LINES there are, and then a loop that is going to define how many characters, including the spaces, that are going on each line.
next:
You have up facing triangles @ 1 char each. You have 2 triangles that have their bases up @ 10 chars each. Then you have 3 spaces. So the first line is going to look like this:
* ********** ********** * = 25 chars
You need to find a way to adjust where the " " is going to be for lines 2 -10. The middle space will always be the same, the first space will need to be added to each time the loop comes around so that it moves right, the third space needs to be subtracted from so that it moves left.
I am working and learning with C# and just finished a similar exercise where we just made the same shapes, just stacked on top of each other. I will see if I can come up with a solution to post here for you and others.
I am not sure on the code right now, but what you need to do is realize the difference between printing just one of those triangles out, stacked on top of each other, and having them all lined up. You need a starting loop that is going to define how many total LINES there are, and then a loop that is going to define how many characters, including the spaces, that are going on each line.
next:
You have up facing triangles @ 1 char each. You have 2 triangles that have their bases up @ 10 chars each. Then you have 3 spaces. So the first line is going to look like this:
* ********** ********** * = 25 chars
You need to find a way to adjust where the " " is going to be for lines 2 -10. The middle space will always be the same, the first space will need to be added to each time the loop comes around so that it moves right, the third space needs to be subtracted from so that it moves left.
I am working and learning with C# and just finished a similar exercise where we just made the same shapes, just stacked on top of each other. I will see if I can come up with a solution to post here for you and others.
Comment