I am stuck on Mario. I keep getting a "redefintion" error in my loops when I try to make the pyramid. My problem is in the conditions part of my for loops, I think.

// Get a number for building the mario pyramid

    printf("Please name the height of Mario's pyramid:");
    pyramid = GetInt();
while (0 > pyramid && pyramid >=23);

//Make a Mario pyramid

int space = pyramid - 1;
int hash = pyramid - space;

for(int i = 0, i < pyramid, i++)
    for(int j = 0, j < space, j++)
        printf(" ");   
    for(int j = 0, j < hash, j++)


  • 1
    Can you please edit your question and post the relevant part of your code? My crystal ball is in the shop. Before you do, please explore the help tab above and read the parts about how to post code so that it formats correctly.
    – Cliff B
    Commented Sep 24, 2015 at 5:33

1 Answer 1


there are a few things wrong with your code:

  1. you want an int from 0 to 23, your while condition isn't checking for that

  2. you want to rethink the loops for printing out spaces and hashes. Use a pen and paper first. What happens if pyramid = 8, as is the illustration in the pset specs, for example? space=7 and hash=1 in the first iteration for the 1st level of the pyramid, which doesn't sound right.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .