I have been working on this problem set for a couple of days now and am still having issues with:
getting the pyramid to print the right number of # marks
getting the right number of spaces to print
when I check on check50 the errors returned are the following and I'm not sure how to interpret these.
:( handles a height of 0 correctly
\ expected an exit code of 0, not output of "\n"
:( handles a height of 1 correctly
\ expected output, but not "#\n##\n"
:( handles a height of 2 correctly
\ expected output, but not "*##\n###\n####\n"
:( handles a height of 23 correctly
\ expected output, but not "**********************#################..."
:( rejects a height of 24
\ expected output, but not "**********************#################..."
Here is my code for this portion where l=line number, h=height, s=spaces c=hashtags
//print out each line
for(l = 0; l < h + 1; l = l + 1)
{
//to align right
for(s = h - l - 1; s > 0; s = s -1)
{
printf("*");
}
//to print hashtags
for(c = 2; c <= (h - 1 + l); c = c + 1)
{
printf("#");
}
printf("\n");