Skip to main content
3 votes
Accepted

Which loop can be replaced for nested for loops for PSET 1 (Mario More Comfortable)?

Hmmm.... Good question for new programmers! The style guide is right, more than 2 or 3 nested for loops should raise red flags, especially if they are based on the same controlling variable as in ...
Cliff B's user avatar
  • 69.1k
2 votes

PSET1:: Mario More Comfortable :: confused about check50 output

What the eye cannot detect......the check50 output will reveal. Notice the difference between what is expected and what is detected: There is an extra "space" between the final # and the \n.
DinoCoderSaurus's user avatar
1 vote
Accepted

Query related to Mario program(more) in CS50 pset1

EEK: The dreaded goto statement!! It's almost always a bad practice to use a goto statement and should be avoided whenever possible!!!! The next bad practice is encapsulating the bulk of a program in ...
Cliff B's user avatar
  • 69.1k
1 vote

When printing mario problem the second triangle appears below the first one

Your went out from you "main" loop for (int i = 0; i < x; i++) and print new line between left and right triangles. So dialog between your and machine is like: Give me a colum Print " " or "#" ...
Egor Fedorets's user avatar
1 vote

I don't know why check50 HATES ME?! mario.more

As per the specification the bottom-left corner of the left-hand pyramid should be left-aligned with the terminal window and therefore the number of preceding spaces should not be hard-coded.
Ashen Gunaratne's user avatar
1 vote

Which loop can be replaced for nested for loops for PSET 1 (Mario More Comfortable)?

There's no problem with having 5 for loops. However, there are several problems with having 5 nested for loops: It's hard to keep track when reading your code That makes it for other people to ...
Peter Pesch's user avatar
  • 1,009
1 vote
Accepted

Trouble with the hacker edition of mario.c

A height of 5 should look like this: Height: 5 # # ## ## ### ### #### #### ##### ##### so this tells you that are you missing the top row. Is there a reason that your for loop has ...
curiouskiwi's user avatar
  • 18.7k
1 vote
Accepted

pset6 problem with mario.more.py, even my output is correct but check50 is still showing error

There should be two spaces between half-pyramids.
Blauelf's user avatar
  • 21k
1 vote
Accepted

pset6 - mario more - check50 EOF error

0 and 23 are valid input values. By using >0 and <23 you exclude them. Use >= and <=.
Blauelf's user avatar
  • 21k
1 vote
Accepted

Troubles with mario.c more

Per the spec, the gap between the two sides should be 2 spaces. You've got one.
curiouskiwi's user avatar
  • 18.7k

Only top scored, non community-wiki answers of a minimum length are eligible