3
votes
So Close on Mario Pyramid
the pseudocode for Mario
for height of pyramid
for (calculate nr. of spaces at height)
print ' '
for (calculate nr. of hashes at height)
print '#'
print a newline
I'd defer ...
2
votes
Accepted
pset1 mario - hashes output
Here's a hint. How many hashes in the first row? The second row? The third row? Does the number of hashes in any given row have any relationship to the height of the pyramid? Or is the number of ...
1
vote
PSET1 Mario pyramid - Can someone explain me the logic of this line of code?
What your code does is, for every time it increases i, it prints '#' 1 times more than i, followed by a /n (line break). To make right aligned, you need another for loop behind the 'loop for columns' ...
1
vote
Error: Expected Expression
Change GetInt(void) to GetInt(). In C, void is a type that of an object with no type. Calling GetInt(void) generates an error because type identifiers (Ex: int, char, double) are not passed into a ...
1
vote
cs50 mario.c more check errors
Looks like check50 got a different file. Maybe you have forgotten to save, or you are in the wrong directory, one where you stored a solution to mario.less? check50 will always upload mario.c from ...
1
vote
Accepted
CS50 2017 Problem Set 6 Mario.py For loop
I don't think it's a good idea to name the loop variable spaces when that name is already taken; that's probably where it goes wrong.
Also, why don't you multiply the spaces like you did with the ...
1
vote
Accepted
Mario pyramid loop arithmetic question
Your math is correct, but your understanding of the variables in the for loop isn't. On the first run, rows = 0, not 1. Look at the for loop setup code:
for (rows = 0; rows < height; rows++)
...
1
vote
Mario Pyramid Upside down
I don't understand your logic for setting the limits of how many #s to print. First, you're printing a blank line. This is because you're using x as a limit, but x is 0 on the first pass. It's 0 ...
1
vote
Accepted
Mario Pyramid - trouble with printing structure
Your code prints out 4 lines of 2 #'s on each line. That's exactly what the code that you wrote should do. The good news is that you have written code that produces the right number of output lines.
...
1
vote
pset 1 Mario's half-pyramid
Per the isdigit()'s man page we see
These functions check whether c, which must have the value of an
unsigned char or EOF, falls into a certain character class according to
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
pyramid × 24mario × 22
pset1 × 15
mario.less × 5
error × 2
cs50x × 1
pset6 × 1
c × 1
python × 1
appliance × 1
help × 1
for-loop × 1
loop × 1
cs50-pset1 × 1
hash × 1
hashes × 1
nested-loops × 1
triangle × 1
expression × 1