0

Feel like im getting closer to solving the problem, the last one i had made worked but was upside down, and this one is right side up but cant seem to get the hashes on the other side and it doesnt produce the amount that i put in, as you can see i put in 8 for the most recent one, any help would much be appreciated.

1 Answer 1

1

It may benefit you to debug your for loops one at a time. Comment out or delete one of the space or hash printing loops, and get your program to the point that it can print some character the way that Mario requires. Then you can tackle the other for loop to print the appending characters. It is much easier to mentally step through your code and tweak your algorithm when you are only trying to solve one problem at a time. It may also help to draw out the Mario pyramid in Notepad or a word processing software, and when done, write out what it is you are trying to solve for (any row n), on each row, as a function of the height of the Pyramid (which you know at runtime).

1
  • not really sure what you mean by debugguing it, i know what debugging means but as you said ive tried commenting out the certain lines of code but get errors when i take out one of the for loops. thanks though for the help ive made a bit of progress towards solving it.
    – Krogh
    Commented Feb 5, 2015 at 1:34

You must log in to answer this question.

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