I’ve gotten stuck on the Less Comfortable Mario set: the height input portion works, but the loop does not execute. I really wanted to figure this out on my own, but I’ve been stuck for days! Please help. Thank you! I wondered if there’s something off with “int spaces = height-1”, but I’ve also set it to a specific integer as a test and it hasn’t worked.
#include <stdio.h>
#include <cs50.h>
int height;
int main(void)
{
{
do
{
height = get_int("Enter desired height: ");
}
while (height < 1);
return height;
}
{
for (int rows = 0; rows < height; rows++)
{
for (int spaces = height-1; spaces <= 0; spaces--)
{
printf(".");
}
for (int hash = 0; hash < height; hash++ )
{
printf("#");
}
printf("\n");
}
}
}