Timeline for Mario code is printing each hash on a different row
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 4, 2014 at 11:40 | comment | added | Ewald Ertl | Check your for-loop for printing the spaces. How dose the count of spaces change, while the row increases? | |
Dec 2, 2014 at 8:38 | comment | added | Jonathan Friedman | Thanks very helpful! However, now I fixed that, and everything is working correctly, except my pyramid is showing up backwards/reversed ie the base is on top and the top at bottom. I have checked the code and don't know what's wrong...can you please take a look? int row; for (row = 0; row < height; row++) { int spaces; for (spaces = height-2; spaces >= 0 ; spaces--) { printf(" "); } for (spaces = row+2; spaces <= height; spaces++) { printf("#"); //hash = height - spaces, goes up each time } printf("\n"); } | |
Dec 1, 2014 at 22:38 | history | edited | Air | CC BY-SA 3.0 |
These should be formatted as fixed type instead of italics since they are code elements.
|
Dec 1, 2014 at 11:45 | review | First posts | |||
Dec 1, 2014 at 22:38 | |||||
Dec 1, 2014 at 11:41 | history | answered | Ewald Ertl | CC BY-SA 3.0 |