Like many others here I am completely new to coding. No experience whatsoever. I have been busy with the less comfortable Mario.c for a while now, trying to understand what is going on every step of the way. So far so good.
As I make my way toward a right-aligned pyramid, I have stumbled into a solution for a left-aligned pyramid by tinkering with the code cs50 provides as a "hint". I've been trying to figure out what the code is doing to make my left-aligned pyramid, but I can't seem to grasp it. Can anyone in layman's terms explain why this particular part of the code does what it does?
Note: I ask the user for an integer between 1 and 8, re-prompting when the number is above or below those numbers. After a valid number is entered, the number is stored and then passed through the following below (I think I am using those terms right!)
I believe it is this part of the program that tells the computer to draw the left-aligned hash pyramid. Why does it do what it does??
for (int i = 0; i < height; i++)
for (int j = 0; j <= i; j++)
{
printf("#");
}
printf("\n")