Ok, just I found this on edX and I have started to work through it. I'm having trouble getting the for loops for Mario in pset1. Everything I get one to work, the other suddenly stops working. Here are the for loops:
for (int i = 0; i < height; i++)
{
for (int j = 0; j < spaceLength; j++){
printf("baba ");
}
for (int k = 0; k < blockLength; k++){
printf("#");
}
printf("#\n");
spaceLength--;
blockLength++;
}
and here is the output:
How high should it be? 8
##
###
####
#####
######
#######
########
#########
Now, before it was doing the spaces, but now it is not. "baba " is there only to make it very visible right now if or where the spaces are.
To what I can see, the order of the for loops is correct and the syntax of the for loops is correct. The first loop just isn't... initializing? Any help would be appreciated.
Andrew
spaceLength
initially?