Skip to main content
11 votes

Error: "make: *** No rule to make target `mario'. Stop."

I thought I was in the correct directory, but I wasn't. (I’m a super newbie.) Execute to show what workspace you’re in “print working directory”: pwd Execute to "list": ls Execute to “change ...
The_NELQ_Coder's user avatar
5 votes

pset1 mario - declaration shadows a local variable

With your usage of int you're creating a new variable. Example: int blocks = 5; {// Just creating a block, similar to a loop int blocks = 4; //Variable inside the block printf("%d\n", blocks); /...
awareness481's user avatar
5 votes
Accepted

pset1 (mario, more) - problem with unwanted leading spaces

What conclusion can be drawn from these two facts? This loop for (row = 0; row <= height; row++) will generate height + 1 lines of output (0 through height inclusive) The first output line (ie row ...
DinoCoderSaurus's user avatar
4 votes

any idea how to fix Mario more comfortable problem "expected output"

check50 is expecting the last # on a line to be followed by the newline. It is complaining about the trailing spaces.
DinoCoderSaurus's user avatar
3 votes
Accepted

cs50 pset1 mario

Let's trace your program. if you take example height = 5 and you enter into your first for loop, the row = 0 and then you enter into second (first nested) for Loop. space = 5-0-1 = 4 There will be ...
Wafeeq's user avatar
  • 549
3 votes

Mario.c : having problems with SCOPE and iteration. Very new to coding

There are a number of issues, some of which I'll point out. Others, I'll leave for you to sort through. Learning to debug is an important skill to learn and this will be a good exercise for you. ;-) ...
Cliff B's user avatar
  • 69k
3 votes
Accepted

PSET1 Mario More: Same output but still displays error

If I remember correctly, there should be two spaces between the half-pyramids. If the output is not put into an HTML pre tag, any contiguous whitespace will be compacted into one space, that's why ...
Blauelf's user avatar
  • 21k
3 votes

did not find EOF Pset 1 mario. expected "##\n", not " ##\n"

In case of a height of zero (which is a valid height), your programme should print zero lines and exit. You probably reject zero as a height and ask again, the tester doesn't expect being prompted for ...
Blauelf's user avatar
  • 21k
3 votes
Accepted

cs50 pset1 mario math wrong or order?

There's a couple of problems. First, height is essentially a constant after it is entered by the user. It represents the number of rows to print, and as such, shouldn't be changed by the program. It ...
DinoCoderSaurus's user avatar
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
  • 69k
3 votes
Accepted

Pset1: Problem: expected “##\n”, not “ ##\n”

Your own question hides the answer, carefully observe the difference: "##\n" " ##\n" There is a space that should not be there, the hashtag must be perfectly aligned to the left. Your program is ...
MARS's user avatar
  • 5,179
3 votes
Accepted

Pset 1 - Mario pyramid trouble with spaces/dots

The problem is your nesting of loops. For each row, you print height-row+1 dots/spaces and one hash, and this whole thing row+1 times. Place your two inner loops on the same level, one after the ...
Blauelf's user avatar
  • 21k
3 votes
Accepted

tests give weird results despite (seemingly) correct output

This expected "# #\n", not " # # \n" is telling you that there is an extra space in front and an extra space at the end. There should be nothing printed after the final # on a line, so that part ...
DinoCoderSaurus's user avatar
3 votes
Accepted

Doing mario.c less comfortable one step at a time

Your analysis is correct, as far as it goes. The rest is pretty simple and is a basic demonstration of nested for loops. To make it clear, let's display the full loop correctly, since the curly ...
Cliff B's user avatar
  • 69k
3 votes
Accepted

cs50 problem set 1 mario. check50 command returns error: 'You seem to be missing these required files: mario.c'

You MUST be in the same directory as the source code to run check50 and submit50. It doesn't work if you're not. The parameter isn't about where the code is located, it's about which tests to run. ...
Cliff B's user avatar
  • 69k
3 votes

Do - While loop

you want to keep asking the user about height if n is smaller than 1 or larger than 8 right ? check your code, the way you're writing it ,the program is gonna keep asking for height as long as n is ...
Mohamad Chaltaf's user avatar
3 votes

pset1 (mario, more) - problem with unwanted leading spaces

You want to repeat your outer loop one less time and print one less space each time. To do this you simply need to change your <= operator in your outer loop and your first space printing loop a &...
Duncan McAlister's user avatar
2 votes
Accepted

My code seems to be working but check50 is giving me this "\ expected output, but not "#\n""

This is an example of making sure to follow the exact specifications. In a pyramid of height 1 (or any height), how many hashes are supposed to be printed on the first line? If this answers your ...
Cliff B's user avatar
  • 69k
2 votes
Accepted

Mario.c I don't understand how to print the pyramid?

Your comments in the code show that you're close, but you don't quite understand the pattern requested. A hidden lesson of this pset is to learn to read and understand exactly and precisely what a ...
Cliff B's user avatar
  • 69k
2 votes

Error: "make: *** No rule to make target `mario'. Stop."

I had the same error and turns out I was in the root directory. You need to be in the mario-more directory to execute the make mario command. Just check if you $ sign has mario-more/ prefix. If not ...
Sanket Pagadpalliwar's user avatar
2 votes

pset 1 mario \ expected an exit code of 0, not output of "Height: "

Per the specs: However, to make things more interesting, first prompt the user for the half-pyramid’s height, a non-negative integer no greater than 23. So, non-negative means height can be from ...
ChrisG's user avatar
  • 7,396
2 votes
Accepted

12 errors for pset1 mario

All are simple syntax errors. Let's look at one of your for statements: for(i=0,i<=h,i++); A for loop setup statement has 3 clauses, the initialization clause, the test clause, and the ...
Cliff B's user avatar
  • 69k
2 votes

MARIO LESS COMFORTABLE

Using the 5 pyramid as a guide: Height: 5          ##        ###      ####  &...
DinoCoderSaurus's user avatar
2 votes

Pset1 Question Mario

See anything wrong here? for (rows = 0; height <= rows; rows++) If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)
Cliff B's user avatar
  • 69k
2 votes
Accepted

Problem with printing the # symbols on mario.c

Your hash loop prints height+1 hashes every time (one per iteration of the inner loop, iterated height+1 times). This does not change over the several rows, as all the variables used have the same ...
Blauelf's user avatar
  • 21k
2 votes
Accepted

pset1: mario - error msg

An easy issue to fix. The syntax of your for loop is incorrect. A for loop statement has three clauses. The clauses are separated by semicolons as in: for( x = 0; x < 10; x++) {...} Your ...
Cliff B's user avatar
  • 69k
2 votes

pset1: mario - error msg

There are just some syntax errors. Remember mate the general format of for loop is: for(initialize ; condition ; increment/decrement) so in for loop you've used comma(,) instead of ...
Ashish Siwal's user avatar
2 votes

pset1 mario less comfortable

I don't want to spoiler your, so I try to give you a hint. If this is not helping you I can get more concrete. You know that the peak of mario's hill is 1 hash wide, so you want to print 1 hash in ...
Noah Haasis's user avatar
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 ...
Cliff B's user avatar
  • 69k
2 votes

Can anyone please help with mario less comfortable?

Simply put, the code doesn't compile, so none of the other tests can be done by check50. Did you actually compile your code and run it first, or did you go straight to check50? The code needs to ...
Cliff B's user avatar
  • 69k

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