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
9 votes

Can't submit or check

Had similar problem with similar message. This is how we found out what was wrong: Executed check50 -h to see what logging options there were. Discovered we can turn on debug logging using --log-...
Tristan's user avatar
  • 198
7 votes
Accepted

CS50 IDE undefined reference to `get_int'

On which version of the workspace are you? The current version as of 2017-11-13 is v125. If update50 doesn't end in an error message, you probably are at that version. Also, how do you compile? The ...
Blauelf's user avatar
  • 21k
6 votes
Accepted

pset1 - "greedy" failing at one value

This is a very common problem and the whole point of greedy.c, so let me try and give the definitive answer. Float values with a decimal part (to the right of the decimal, in case you weren't certain)...
Cliff B's user avatar
  • 69k
6 votes
Accepted

Check50 and style50 not working: pset1

So apparently markupsafe was upgraded and soft_unicode does not exist in it anymore. I downgraded markupsafe to 2.0.1 and it fixed the issue for me: pip install markupsafe==2.0.1
Wajeeha Abid's user avatar
5 votes
Accepted

pset1 greedy checking problem

True that check50 is strict about the output. Here is what the instructions say Incidentally, so that we can automate some tests of your code, we ask that your program’s last line of output be ...
DinoCoderSaurus's user avatar
5 votes

My processor does not support hardware virtualisation for cs50 offline IDE

As far as I know, there's only 2 things needed to compile programs that use the code examples from the CS50 course. The cs50.h header file, and the cs50 library (linked when -lcs50 is passed to the ...
Andy Alt's user avatar
  • 302
5 votes
Accepted

pset 1 fatal error: 'studio.h' file not found

This is a small syntax error, <studio.h> it should be <stdio.h>
MARS's user avatar
  • 5,179
5 votes
Accepted

Getting error in pset1 mario more

Hmmm, this looks like a unique problem. ;-) check50 expects very exact output. That means that any missing or extra content, like whitespace, prompts, punctuation, characters, spaces, or anything ...
Cliff B's user avatar
  • 69k
5 votes
Accepted

Cannot Compile - Error Message: *** No rule to make target

From the view of the folder tree on the left we see that the .c files are in a directory under workspace named pset1. At the bottom we see that the compile is being run from the workspace directory. ...
DinoCoderSaurus's user avatar
5 votes
Accepted

clang: error: no such file or directory: 'hello.c'

This will happen if you accidentally saved the file name as "hello.c " (with a space following the c). First, the icon for hello.c in the file tree shows as a text file. It should show as a C file ...
DinoCoderSaurus's user avatar
5 votes

pset1 credit, need advice

You could take the number as a string, and access the individual digits as characters (subtract '0' or 48 to obtain their value), or parse the number as a long long int and use for example / and % in ...
Blauelf's user avatar
  • 21k
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

Greedy Compiling issue

You have multiple issues. Firstly, your linker errors undefined reference to ... means the linker can't find the functions you are using. In order to tell clang to link with the cs50 library for ...
robert_x44's user avatar
5 votes

credit - Why this AMEX and MASTERCARD numbers are considered invalid?

Found it: American Express starts with 34 or 37, Master Card starts with 51, 52, 53, 54 or 55. This makes those two numbers INVALID despite good checksum :)
smajli's user avatar
  • 163
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
5 votes
Accepted

I keep getting "expected EOF" when I use check50

When the code is run with the test data that check50 uses, 4111111111111113, it prints INVALID twice. check50 was expecting the program to end, not to print the second INVALID. The problem is obvious ...
Cliff B's user avatar
  • 69k
4 votes
Accepted

Stuck on PSet1: I have the correct output, but Check50 output says it's wrong

edited question From the spec: Take care to left-align the bottom-left corner of the left-hand half-pyramid with the left-hand edge of your terminal window. In other words, the last line must ...
DinoCoderSaurus's user avatar
4 votes
Accepted

pset1.greedy did not use modulo

In programming, there are often several ways to do the same task. If they work, they are "correct". But now, you need to start thinking about efficiency. In these assignments, the efficiency is ...
Cliff B's user avatar
  • 69k
4 votes
Accepted

Pset1 error: expected identifier or '('

The body of the main function must go between keys, the compiler interprets that as the keys are missing, declaring a function before main (this will be seen later) the solution is simple: int main(...
MARS's user avatar
  • 5,179
4 votes
Accepted

Can I declare a variable *within* a do-while loop?

Yes and no. Yes, it is possible, and perfectly permissible to declare height inside the do/while loop, but there's a problem. If you only wanted to use height inside the loop, it's fine. But, the ...
Cliff B's user avatar
  • 69k
4 votes

Why am I getting this error message? (integer.c:7:10: error: expected ';' at end of declaration)

The C syntax for variable declaration and value assignment in a single declaration is as follows int variable_name = value; The get_int() function returns the int equivalent to the line read from ...
Ashen Gunaratne's user avatar
4 votes
Accepted

Error of Undeclared Identifier in the for loop

In order to understand why your code is wrong and how you can fix it, you should first understand the concept of variables. Before you can assign a value to a variable, you have to declare it, which ...
Larpee's user avatar
  • 196
4 votes
Accepted

pset 1 - cash problem - No errors, am rounding, but still not always correct amount of coins

'while (cent >= 0.25)' here you have accidentally written dollar amount instead of cents.
Himanshi's user avatar
  • 401
4 votes

pset1 cash 2022

Looks like you are using the 2022 version of check against the 2021 version of pset1 cash. The 2022 version of the pset has a new function to implement called get_cents. (There may be other ...
DinoCoderSaurus's user avatar
4 votes
Accepted

variable used in loop condition not modifies in loop body

Well, I had to think carefully about what the code is doing. That mostly comes from not using a best practice. Here's the best-practice guideline on whether to use a FOR loop or a WHILE loop. When ...
Cliff B's user avatar
  • 69k
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
Accepted

Organizing do while

There are two major issues here - scope and infinite loops - along with the do/while vs. while issue. Scope: When you declare a variable, it only exists between the immediate set of curly braces that ...
Cliff B's user avatar
  • 69k
3 votes

PSET1 - Water fails check50: "expected prompt for input, not exit code of 0"

One option would be to simply use the GetInt(); function in the cs50.h library since it already reprompts the user for input if they give bogus values. Or implement the feature yourself and use a ...
NullityNull's user avatar
3 votes

My processor does not support hardware virtualisation for cs50 offline IDE

You can do all the psets locally and just use the cs50 IDE online to verify your code with check50. To download the cs50 library go here https://manual.cs50.net/library/
Daniel P.'s user avatar

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